File tree 9 files changed +42
-22
lines changed
packages/create-vue-lib/src/template
config/packages/@projectName@
examples/packages/@projectName@/src
playground/config/packages/playground
vitepress/config/packages/docs
9 files changed +42
-22
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ /// <reference types =" vite/client" />
2
+
1
3
declare const __DEV__: boolean
2
4
<% _ if (config .includeTestVariable ) { _% >
3
5
declare const __TEST__: boolean
Original file line number Diff line number Diff line change 2
2
import { ref } from ' vue'
3
3
4
4
if (__DEV__ ) {
5
- console .log (' dev: creating ExampleComponent' )
6
- < % _ if (config .includeTestVariable ) { _% >
7
- console .log (` __TEST__: ${ __TEST__ } ` )
8
- < % _ } _% >
5
+ console .log (' [<%- config.scopedPackageName %>] creating ExampleComponent' )
9
6
}
10
7
11
8
const msg = ref (' Hello world!' )
Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
+ import { provide } from ' vue'
2
3
import MyPanelSection from ' ./MyPanelSection.vue'
3
4
4
5
defineProps <{
5
6
title? : string
6
7
footer? : string
7
8
}>()
9
+
10
+ if (__DEV__ ) {
11
+ provide (' MyPanel' , true )
12
+ }
8
13
</script >
9
14
10
15
<template >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ <script setup lang =" ts" >
2
+ import { inject , provide } from ' vue'
3
+
4
+ if (__DEV__ ) {
5
+ const insideMyPanel = inject (' MyPanel' , false )
6
+
7
+ if (! insideMyPanel) {
8
+ console .warn (' [<%- config.scopedPackageName %>] MyPanelSection can only be used inside MyPanel' )
9
+ }
10
+
11
+ provide (' MyPanel' , false )
12
+ }
13
+ </script >
14
+
15
+ <template >
16
+ <div class =" panel-section" >
17
+ <slot />
18
+ </div >
19
+ </template >
20
+
21
+ <style scoped >
22
+ .panel-section {
23
+ padding : 10px ;
24
+ }
25
+ </style >
Original file line number Diff line number Diff line change 1
1
export { default as ExampleComponent } from './components/ExampleComponent.vue'
2
2
export { default as MyPanel } from './components/MyPanel.vue'
3
3
export { default as MyPanelSection } from './components/MyPanelSection.vue'
4
+
5
+ if (__DEV__) {
6
+ console.log('[<% - config .scopedPackageName %> ] dev mode')
7
+ <% _ if (config .includeTestVariable ) { _% >
8
+ console .log (` [<%- config.scopedPackageName %>] __TEST__: ${ __TEST__ } ` )
9
+ < % _ } _%>
10
+ }
Original file line number Diff line number Diff line change 1
1
/// <reference types="vite/client" />
2
2
3
- import '../@projectName@/src/global .d.ts'
3
+ import '../@projectName@/env .d.ts'
Original file line number Diff line number Diff line change 1
1
/// <reference types="vite/client" />
2
2
3
- import '../@projectName@/src/global .d.ts'
3
+ import '../@projectName@/env .d.ts'
You can’t perform that action at this time.
0 commit comments