commit
fd615943bb
13 changed files with 2428 additions and 0 deletions
@ -0,0 +1,2 @@ |
|||||
|
node_modules |
||||
|
dist |
@ -0,0 +1,12 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="en"> |
||||
|
<head> |
||||
|
<meta charset="UTF-8"> |
||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||
|
<title>Document</title> |
||||
|
</head> |
||||
|
<body> |
||||
|
<div id="app"></div> |
||||
|
<script type="module" src="/play/main.ts"></script> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,32 @@ |
|||||
|
{ |
||||
|
"name": "vx-tree", |
||||
|
"version": "1.0.0", |
||||
|
"description": "", |
||||
|
"main": "dist/vx-tree.js", |
||||
|
"exports": { |
||||
|
".": { |
||||
|
"import": "./dist/vx-tree.mjs", |
||||
|
"require": "./dist/vx-tree.js" |
||||
|
} |
||||
|
}, |
||||
|
"files": [ |
||||
|
"dist" |
||||
|
], |
||||
|
"scripts": { |
||||
|
"dev": "somebuild dev", |
||||
|
"watch": "somebuild build --watch", |
||||
|
"watch:debug": "somebuild build --watch --debug", |
||||
|
"build": "somebuild build" |
||||
|
}, |
||||
|
"keywords": [], |
||||
|
"author": "", |
||||
|
"license": "ISC", |
||||
|
"devDependencies": { |
||||
|
"@somebuild/build-component-vue3": "^1.0.0", |
||||
|
"somebuild": "^1.0.0", |
||||
|
"vue": "^3.5.12" |
||||
|
}, |
||||
|
"peerDependencies": { |
||||
|
"vue": ">3" |
||||
|
} |
||||
|
} |
@ -0,0 +1,9 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<VxTree aaa="2131"></VxTree> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import VxTree from "vx-tree"; |
||||
|
</script> |
@ -0,0 +1,5 @@ |
|||||
|
import VxTree from "vx-tree"; |
||||
|
import { createApp } from "vue"; |
||||
|
import App from "./App.vue"; |
||||
|
|
||||
|
createApp(App).use(VxTree).mount("#app"); |
File diff suppressed because it is too large
@ -0,0 +1,16 @@ |
|||||
|
import { defineRootConfig } from 'somebuild' |
||||
|
|
||||
|
export default defineRootConfig({ |
||||
|
mode: "component-vue3", |
||||
|
"component-vue3": { |
||||
|
name: "VxTree", |
||||
|
entry: 'src/index.ts', |
||||
|
dtsEntryRoot: 'src', |
||||
|
outDir: "dist", |
||||
|
config: { |
||||
|
alias: { |
||||
|
"vx-tree": "./src" |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}) |
@ -0,0 +1,8 @@ |
|||||
|
import type { App } from "vue"; |
||||
|
import _VxTree from "./src"; |
||||
|
import { withInstall } from "./utils"; |
||||
|
|
||||
|
const VxTree = withInstall(_VxTree, "VxTree"); |
||||
|
|
||||
|
export { VxTree }; |
||||
|
export default VxTree; |
@ -0,0 +1,4 @@ |
|||||
|
import VxTree from "./vx-tree.vue"; |
||||
|
|
||||
|
export default VxTree; |
||||
|
export { VxTree }; |
@ -0,0 +1,3 @@ |
|||||
|
export interface IProps { |
||||
|
aaa?: string; |
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
<template> |
||||
|
<div>组件模板开发</div> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts" setup> |
||||
|
import type { IProps } from "./type"; |
||||
|
|
||||
|
defineOptions({ |
||||
|
name: "VxTree", |
||||
|
}); |
||||
|
|
||||
|
defineProps<IProps>(); |
||||
|
|
||||
|
function handleClick() {} |
||||
|
</script> |
@ -0,0 +1,10 @@ |
|||||
|
import type { Plugin, DefineComponent } from "vue"; |
||||
|
|
||||
|
export type SFCWithInstall<T> = T & Plugin; |
||||
|
|
||||
|
export const withInstall = <T>(main: T, name: string) => { |
||||
|
(main as SFCWithInstall<T>).install = (app): void => { |
||||
|
app.component((main as DefineComponent).name || name, main); |
||||
|
}; |
||||
|
return main as SFCWithInstall<T>; |
||||
|
}; |
@ -0,0 +1,12 @@ |
|||||
|
{ |
||||
|
"compilerOptions": { |
||||
|
"module": "ESNext", |
||||
|
"moduleResolution": "bundler", |
||||
|
"baseUrl": ".", |
||||
|
"paths": { |
||||
|
"vx-tree/*": ["src/*"], |
||||
|
"vx-tree": ["src/index.ts"] |
||||
|
} |
||||
|
}, |
||||
|
"include": ["play", "src"] |
||||
|
} |
Loading…
Reference in new issue