create-component-template-cli 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.changeset/config.json +1 -1
- package/AGENTS.md +114 -0
- package/CHANGELOG.md +13 -1
- package/CLAUDE.md +20 -8
- package/README.md +49 -21
- package/bin/cli.mjs +38 -29
- package/docs/2026-05-11T10-04-44-/344/270/211/345/245/227/346/250/241/346/235/277/351/207/215/346/236/204/2026-05-11T10-04-44-/344/270/211/345/245/227/346/250/241/346/235/277/351/207/215/346/236/204-/346/200/235/350/267/257/346/226/207/346/241/243.md +167 -0
- package/docs/2026-05-11T10-04-44-/344/270/211/345/245/227/346/250/241/346/235/277/351/207/215/346/236/204/2026-05-11T10-04-44-/344/270/211/345/245/227/346/250/241/346/235/277/351/207/215/346/236/204-/346/200/273/347/273/223/346/226/207/346/241/243.md +80 -0
- package/docs/2026-05-11T10-04-44-/344/270/211/345/245/227/346/250/241/346/235/277/351/207/215/346/236/204/2026-05-11T10-04-44-/344/270/211/345/245/227/346/250/241/346/235/277/351/207/215/346/236/204-/350/256/276/350/256/241/346/226/271/346/241/210.md +477 -0
- package/docs/2026-05-11T12-35-00-npx/346/211/247/350/241/214/345/205/245/345/217/243/344/277/256/345/244/215/2026-05-11T12-35-00-npx/346/211/247/350/241/214/345/205/245/345/217/243/344/277/256/345/244/215-/345/256/236/346/226/275/346/226/271/346/241/210.md +66 -0
- package/docs/2026-05-11T12-35-00-npx/346/211/247/350/241/214/345/205/245/345/217/243/344/277/256/345/244/215/2026-05-11T12-35-00-npx/346/211/247/350/241/214/345/205/245/345/217/243/344/277/256/345/244/215-/346/200/235/350/267/257/346/226/207/346/241/243.md +69 -0
- package/docs/2026-05-11T12-35-00-npx/346/211/247/350/241/214/345/205/245/345/217/243/344/277/256/345/244/215/2026-05-11T12-35-00-npx/346/211/247/350/241/214/345/205/245/345/217/243/344/277/256/345/244/215-/346/200/273/347/273/223/346/226/207/346/241/243.md +27 -0
- package/package.json +4 -3
- package/plop-templates/general/data.ts.hbs +16 -0
- package/plop-templates/general/hook.ts.hbs +11 -0
- package/plop-templates/general/index.normal.vue.hbs +28 -0
- package/plop-templates/general/index.scss.hbs +5 -0
- package/plop-templates/general/index.setup.vue.hbs +20 -0
- package/plop-templates/{index.ts.hbs → general/index.ts.hbs} +2 -1
- package/plop-templates/general/typing.ts.hbs +13 -0
- package/plop-templates/multiple-pick/data.ts.hbs +20 -0
- package/plop-templates/multiple-pick/hook.ts.hbs +11 -0
- package/plop-templates/multiple-pick/index.normal.vue.hbs +37 -0
- package/plop-templates/multiple-pick/index.scss.hbs +5 -0
- package/plop-templates/multiple-pick/index.setup.vue.hbs +22 -0
- package/plop-templates/multiple-pick/index.ts.hbs +4 -0
- package/plop-templates/multiple-pick/typing.ts.hbs +13 -0
- package/plop-templates/single-pick/data.ts.hbs +16 -0
- package/plop-templates/single-pick/hook.ts.hbs +11 -0
- package/plop-templates/single-pick/index.normal.vue.hbs +36 -0
- package/plop-templates/single-pick/index.scss.hbs +5 -0
- package/plop-templates/single-pick/index.setup.vue.hbs +23 -0
- package/plop-templates/single-pick/index.ts.hbs +4 -0
- package/plop-templates/single-pick/typing.ts.hbs +13 -0
- package/plopfile.mjs +68 -59
- package/src/generate.mjs +101 -31
- package/tmp-output/GeneralNormalDemo/index.ts +4 -0
- package/tmp-output/GeneralNormalDemo/src/data.ts +16 -0
- package/tmp-output/GeneralNormalDemo/src/hook.ts +11 -0
- package/tmp-output/GeneralNormalDemo/src/index.scss +5 -0
- package/tmp-output/GeneralNormalDemo/src/index.vue +28 -0
- package/tmp-output/GeneralNormalDemo/src/typing.ts +13 -0
- package/tmp-output/GeneralSetupDemo/index.ts +4 -0
- package/tmp-output/GeneralSetupDemo/src/data.ts +16 -0
- package/tmp-output/GeneralSetupDemo/src/hook.ts +11 -0
- package/tmp-output/GeneralSetupDemo/src/index.scss +5 -0
- package/tmp-output/GeneralSetupDemo/src/index.vue +20 -0
- package/tmp-output/GeneralSetupDemo/src/typing.ts +13 -0
- package/tmp-output/MultiplePickNormalDemo/index.ts +4 -0
- package/tmp-output/MultiplePickNormalDemo/src/data.ts +20 -0
- package/tmp-output/MultiplePickNormalDemo/src/hook.ts +11 -0
- package/tmp-output/MultiplePickNormalDemo/src/index.scss +5 -0
- package/tmp-output/MultiplePickNormalDemo/src/index.vue +37 -0
- package/tmp-output/MultiplePickNormalDemo/src/typing.ts +13 -0
- package/tmp-output/MultiplePickSetupDemo/index.ts +4 -0
- package/tmp-output/MultiplePickSetupDemo/src/data.ts +20 -0
- package/tmp-output/MultiplePickSetupDemo/src/hook.ts +11 -0
- package/tmp-output/MultiplePickSetupDemo/src/index.scss +5 -0
- package/tmp-output/MultiplePickSetupDemo/src/index.vue +22 -0
- package/tmp-output/MultiplePickSetupDemo/src/typing.ts +13 -0
- package/tmp-output/SinglePickNormalDemo/index.ts +4 -0
- package/tmp-output/SinglePickNormalDemo/src/data.ts +16 -0
- package/tmp-output/SinglePickNormalDemo/src/hook.ts +11 -0
- package/tmp-output/SinglePickNormalDemo/src/index.scss +5 -0
- package/tmp-output/SinglePickNormalDemo/src/index.vue +36 -0
- package/tmp-output/SinglePickNormalDemo/src/typing.ts +13 -0
- package/tmp-output/SinglePickSetupDemo/index.ts +4 -0
- package/tmp-output/SinglePickSetupDemo/src/data.ts +16 -0
- package/tmp-output/SinglePickSetupDemo/src/hook.ts +11 -0
- package/tmp-output/SinglePickSetupDemo/src/index.scss +5 -0
- package/tmp-output/SinglePickSetupDemo/src/index.vue +23 -0
- package/tmp-output/SinglePickSetupDemo/src/typing.ts +13 -0
- package/plop-templates/data.ts.hbs +0 -7
- package/plop-templates/hook.ts.hbs +0 -29
- package/plop-templates/index.scss.hbs +0 -1
- package/plop-templates/index.setup.vue.hbs +0 -25
- package/plop-templates/index.vue.hbs +0 -38
- package/plop-templates/typing.ts.hbs +0 -14
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="single-pick-setup-demo">
|
|
3
|
+
<SinglePickButtonGroup />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import SinglePickButtonGroup from '@/components/common/SinglePickButtonGroup'
|
|
9
|
+
import { SinglePickSetupDemoProps } from './typing'
|
|
10
|
+
import { useSinglePickSetupDemo } from './hook'
|
|
11
|
+
|
|
12
|
+
defineOptions({
|
|
13
|
+
name: 'SinglePickSetupDemo',
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const props = defineProps<SinglePickSetupDemoProps>()
|
|
17
|
+
|
|
18
|
+
const { selectedValue } = useSinglePickSetupDemo(props)
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<style lang="scss" scoped>
|
|
22
|
+
@import './index.scss';
|
|
23
|
+
</style>
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ref } from 'vue';
|
|
2
|
-
import { data } from './data'
|
|
3
|
-
import { useTimeline } from '@/hooks';
|
|
4
|
-
import { {{ componentName }}Props } from './typing'
|
|
5
|
-
import emitter, { useEmitter } from '@/base/toolkit';
|
|
6
|
-
import { usePlatformStore, useProductStore, useGlobalStore } from '@/store';
|
|
7
|
-
import { ButtonGroupItem } from '@/components/common/SinglePickButtonGroup';
|
|
8
|
-
export const use{{componentName}} = (props: {{componentName}}Props) => {
|
|
9
|
-
const model = ref<string>('')
|
|
10
|
-
const platformStore = usePlatformStore();
|
|
11
|
-
const productStore = useProductStore();
|
|
12
|
-
const globalStore = useGlobalStore();
|
|
13
|
-
|
|
14
|
-
useTimeline(model,({currentTime,productTypes})=>{
|
|
15
|
-
// TODO 产品绑定时间轴,时间轴变化请求数据
|
|
16
|
-
})
|
|
17
|
-
useEmitter([
|
|
18
|
-
{
|
|
19
|
-
eventName:'test',
|
|
20
|
-
callback:()=> {
|
|
21
|
-
// TODO
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
])
|
|
25
|
-
|
|
26
|
-
return {
|
|
27
|
-
model
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.{{class}} { position:absolute;z-index:999;width:500px;height:500px;top:0;left:0;background-color:#327ccb52}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="{{ class }}"></div>
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script setup lang="ts">
|
|
6
|
-
import { {{ componentName }}Props, {{ componentName }}Enum } from './typing'
|
|
7
|
-
import { use{{componentName}} } from './hook'
|
|
8
|
-
import SinglePickButtonGroup from '@/components/common/SinglePickButtonGroup';
|
|
9
|
-
|
|
10
|
-
defineOptions({
|
|
11
|
-
name: `{{ componentName }}`
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
const props = defineProps<{{ componentName }}Props>();
|
|
15
|
-
|
|
16
|
-
// withDefaults(defineProps<{{ componentName }}Props>(), {});
|
|
17
|
-
|
|
18
|
-
const { } = use{{componentName}}(props);
|
|
19
|
-
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
<style lang="scss" scoped>
|
|
23
|
-
@import './index.scss';
|
|
24
|
-
// 如果有用到v-bind(),它在index.scss中定义会不生效,请在该文件内写入对应的样式。
|
|
25
|
-
</style>
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
<template>
|
|
4
|
-
<div class="{{ class }}"></div>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script lang="ts">
|
|
8
|
-
import {
|
|
9
|
-
defineComponent,
|
|
10
|
-
PropType
|
|
11
|
-
} from 'vue';
|
|
12
|
-
import { {{ componentName }}Props, {{ componentName }}Enum } from './typing'
|
|
13
|
-
import { use{{componentName}} } from './hook'
|
|
14
|
-
import SinglePickButtonGroup, { ButtonGroupItem } from '@/components/common/SinglePickButtonGroup';
|
|
15
|
-
export default defineComponent({
|
|
16
|
-
name: `{{ componentName }}`,
|
|
17
|
-
components: { },
|
|
18
|
-
props:{
|
|
19
|
-
// 示例,使用 PropType 强制指定接口类型
|
|
20
|
-
user: {
|
|
21
|
-
type: Object as PropType<{{ componentName }}Props['user']>,
|
|
22
|
-
required: false,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
setup(props, { emit }) {
|
|
26
|
-
|
|
27
|
-
const { } = use{{componentName}}(props)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return {};
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
</script>
|
|
34
|
-
|
|
35
|
-
<style lang="scss" scoped>
|
|
36
|
-
@import './index.scss';
|
|
37
|
-
// 如果有用到v-bind(),它在index.scss中定义会不生效,请在该文件内写入对应的样式。
|
|
38
|
-
</style>
|