File tree Expand file tree Collapse file tree 2 files changed +68
-0
lines changed Expand file tree Collapse file tree 2 files changed +68
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,40 @@ app.mount('#app')
4444</template>
4545```
4646
47+ ### On-demand Manual Import
48+
49+ You can manually import the components you need (components consist of logic files and style files):
50+
51+ ``` ts
52+ // main.ts
53+ import { StSayHello } from ' starter-lib-vue3'
54+ import { createApp } from ' vue'
55+ import App from ' ./App.vue'
56+
57+ import ' starter-lib-vue3/dist/es/say-hello/SayHello.css'
58+
59+ const app = createApp (App )
60+
61+ app .use (StSayHello ).mount (' #app' )
62+ ```
63+
64+ Or import and use in SFC:
65+
66+ ``` vue
67+ <script>
68+ import { StSayHello } from 'starter-lib-vue3'
69+ import 'starter-lib-vue3/dist/es/say-hello/SayHello.css'
70+
71+ export default {
72+ components: { StSayHello },
73+ }
74+ </script>
75+
76+ <template>
77+ <StSayHello />
78+ </template>
79+ ```
80+
4781## Browser Direct Import
4882
4983You can use the global variable ` StarterLibVue3 ` by importing directly through the browser's HTML ` script ` tag.
Original file line number Diff line number Diff line change @@ -44,6 +44,40 @@ app.mount('#app')
4444</template>
4545```
4646
47+ ### 按需手动导入
48+
49+ 你可已手动导入你需要的组件(组件由逻辑文件和样式文件组成):
50+
51+ ``` ts
52+ // main.ts
53+ import { StSayHello } from ' starter-lib-vue3'
54+ import { createApp } from ' vue'
55+ import App from ' ./App.vue'
56+
57+ import ' starter-lib-vue3/dist/es/say-hello/SayHello.css'
58+
59+ const app = createApp (App )
60+
61+ app .use (StSayHello ).mount (' #app' )
62+ ```
63+
64+ 或者在 SFC 中导入使用:
65+
66+ ``` vue
67+ <script>
68+ import { StSayHello } from 'starter-lib-vue3'
69+ import 'starter-lib-vue3/dist/es/say-hello/SayHello.css'
70+
71+ export default {
72+ components: { StSayHello },
73+ }
74+ </script>
75+
76+ <template>
77+ <StSayHello />
78+ </template>
79+ ```
80+
4781## 浏览器直接引入
4882
4983直接通过浏览器的 HTML ` script ` 标签导入就可以使用全局变量 ` StarterLibVue3 ` 了。
You can’t perform that action at this time.
0 commit comments