当前位置:网站首页>[nuxt 3] (XI) transmission & module
[nuxt 3] (XI) transmission & module
2022-07-25 14:34:00 【choukin】
“ You people here , Five thousand roses were planted in one garden , But I can't find what I'm looking for .” ———— 《 The little prince 》
delivery
Vue 3 Built in <Teleport> Components Allow component content to be rendered to Vue Any external DOM On .
<teleport> Of to attribute , Receive one CSS Selectors , Or a real DOM node .Nuxt at present SSR Some support eating Transferred to the body, The client is going to use <ClientOnly> Support rendering to other targets after wrapping .
Example : body teleport
<template>
<button @click="open = true">
Open Modal
</button>
<Teleport to="body">
<div v-if="open" class="modal">
<p>Hello from the modal!</p>
<button @click="open = false">
Close
</button>
</div>
</Teleport>
</template>
Example : client-side teleport
<ClientOnly>
<Teleport to="#some-selector">
<!-- content -->
</Teleport>
</ClientOnly>
</template>
modular
Nuxt A module system is provided to extend the core of the framework and simplify the integration . For existing modules , You need to redevelop or maintain scaffolding , You can nuxt.config Add the module you want to use .
Explore Nuxt modular
When using Nuxt When developing production level applications , You may find that the core functions of the framework are not enough .Nuxt It can be extended through configuration options and plug-ins , But maintaining these configurations in multiple projects can be cumbersome , And repeat . On the other hand , The need to support each project out of the box will make Nuxt Become very complex and difficult to use .
This is a Nuxt One reason to provide a modular system to expand core functions .Nuxt Modules are asynchronous functions , In execution nuxi dev or nuxi build They will execute in sequence . They can replace templates , To configure webpackde loaders , add to CSS library , And perform many other useful tasks .
The best thing is ,Nuxt Modules can be accessed through npm Package management , This allows them to be reused across projects and shared with the community , Help create a high-quality add-on ecosystem .
Extended reading [1]
modules attribute
After installing the module , You can add them to nuxt.config.ts In the document modules Properties of the . The developer of the module usually provides additional operation steps and usage details .
export default defineNuxtConfig({
modules: [
// Using package name (recommended usage)
'@nuxtjs/example',
// Load a local module
'./modules/example',
// Add module with inline-options
['./modules/example', { token: '123' }]
// Inline module definition
async (inlineOptions, nuxt) => { }
]
})
Nuxt Modules are now available only at build time ,Nuxt2 in buildModules Attributes are modules To replace the .
Module development
Everyone can develop modules , stay Module development guidelines Read more about development modules .
Reference material
Nuxt 3 Compatible Modules: https://modules.nuxtjs.org/?version=3.x"
边栏推荐
- 元器件采购系统的主要功能,数字化采购助力元器件企业飞速发展
- ~4.1 sword finger offer 05. replace spaces
- The security market has entered a trillion era, and the security B2B online mall platform has been accurately connected to deepen the enterprise development path
- bond0脚本
- Practical guide for network security emergency response technology (Qianxin)
- pt100测温电路图(ad590典型的测温电路)
- Paddlenlp之UIE关系抽取模型【高管关系抽取为例】
- thymeleaf通过样式控制display是否显示
- Detailed explanation of Telnet remote login AAA mode [Huawei ENSP]
- The concept and operation rules of calculus of variations
猜你喜欢

Alibaba cloud installs mysql5.7

Realize a family security and environmental monitoring system (I)

Under the epidemic, the biomedical industry may usher in breakthrough development
![Application practice: Great integrator of the paddy classification model [paddlehub, finetune, prompt]](/img/b6/62a346174bfa63fe352f9ef7596bfc.png)
Application practice: Great integrator of the paddy classification model [paddlehub, finetune, prompt]

Keys and scan based on redis delete keys with TTL -1

English语法_不定代词 - other / another

51单片机学习笔记(1)

疫情之下,生物医药行业或将迎来突破性发展

sqli-labs Basic Challenges Less1-10

实现一个家庭安防与环境监测系统(一)
随机推荐
Easy entry natural language processing series 12 hidden Markov models
Nuc980 set up SSH xshell connection
Apple failed to synchronize on its mobile terminal, and logged out. As a result, it could not log in again
How to make a set of code fit all kinds of screens perfectly?
[cartographer_ros] VIII: Official demo parameter configuration and effect
华为ensp路由器静态路由(默认路由的下一跳地址)
Save the image with gaussdb (for redis), and the recommended business can easily reduce the cost by 60%
SSM framework integration, simple case
Feiwo technology IPO meeting: annual revenue of 1.13 billion Hunan Cultural Tourism and Yuanli investment are shareholders
Paddlenlp之UIE关系抽取模型【高管关系抽取为例】
Educational Codeforces Round 132 (Rated for Div. 2) C,D+AC自动机
GameFramework制作游戏(二)制作UI界面
Development of uni app offline ID card identification plug-in based on paddleocr
应用实践:Paddle分类模型大集成者[PaddleHub、Finetune、prompt]
基于redis的keys、scan删除ttl为-1的key
Idea regular expression replacement (idea regular search)
pytorch训练代码编写技巧、DataLoader、爱因斯坦标示
Numpy basic package for data analysis
Filters get the data in data; Filters use data in data
Vs2017 large factory ERP management system source code factory general ERP source code