Compare commits
7 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
61e256b662 | 1 week ago |
|
|
196e59fa15 | 1 week ago |
|
|
cf939fa824 | 1 week ago |
|
|
8a6e18562f | 2 weeks ago |
|
|
e51a0ee12a | 2 weeks ago |
|
|
a998dc22a9 | 2 weeks ago |
|
|
c1ab2d8791 | 2 weeks ago |
29 changed files with 15005 additions and 1859 deletions
@ -1,2 +1,3 @@ |
|||||
node_modules |
node_modules |
||||
dist |
dist |
||||
|
docs/.vitepress/cache |
||||
@ -0,0 +1,89 @@ |
|||||
|
{ |
||||
|
// Disable the default formatter, use eslint instead |
||||
|
"prettier.enable": false, |
||||
|
"editor.formatOnSave": false, |
||||
|
"eslint.format.enable": true, |
||||
|
// Auto fix |
||||
|
"editor.codeActionsOnSave": { |
||||
|
"source.fixAll.eslint": "explicit", |
||||
|
"source.organizeImports": "never" |
||||
|
}, |
||||
|
// Silent the stylistic rules in you IDE, but still auto fix them |
||||
|
"eslint.rules.customizations": [ |
||||
|
{ |
||||
|
"rule": "style/*", |
||||
|
"severity": "off", |
||||
|
"fixable": true |
||||
|
}, |
||||
|
{ |
||||
|
"rule": "format/*", |
||||
|
"severity": "off", |
||||
|
"fixable": true |
||||
|
}, |
||||
|
{ |
||||
|
"rule": "*-indent", |
||||
|
"severity": "off", |
||||
|
"fixable": true |
||||
|
}, |
||||
|
{ |
||||
|
"rule": "*-spacing", |
||||
|
"severity": "off", |
||||
|
"fixable": true |
||||
|
}, |
||||
|
{ |
||||
|
"rule": "*-spaces", |
||||
|
"severity": "off", |
||||
|
"fixable": true |
||||
|
}, |
||||
|
{ |
||||
|
"rule": "*-order", |
||||
|
"severity": "off", |
||||
|
"fixable": true |
||||
|
}, |
||||
|
{ |
||||
|
"rule": "*-dangle", |
||||
|
"severity": "off", |
||||
|
"fixable": true |
||||
|
}, |
||||
|
{ |
||||
|
"rule": "*-newline", |
||||
|
"severity": "off", |
||||
|
"fixable": true |
||||
|
}, |
||||
|
{ |
||||
|
"rule": "*quotes", |
||||
|
"severity": "off", |
||||
|
"fixable": true |
||||
|
}, |
||||
|
{ |
||||
|
"rule": "*semi", |
||||
|
"severity": "off", |
||||
|
"fixable": true |
||||
|
} |
||||
|
], |
||||
|
// Enable eslint for all supported languages |
||||
|
"eslint.validate": [ |
||||
|
"javascript", |
||||
|
"javascriptreact", |
||||
|
"typescript", |
||||
|
"typescriptreact", |
||||
|
"vue", |
||||
|
"html", |
||||
|
"markdown", |
||||
|
"json", |
||||
|
"json5", |
||||
|
"jsonc", |
||||
|
"yaml", |
||||
|
"toml", |
||||
|
"xml", |
||||
|
"gql", |
||||
|
"graphql", |
||||
|
"astro", |
||||
|
"svelte", |
||||
|
"css", |
||||
|
"less", |
||||
|
"scss", |
||||
|
"pcss", |
||||
|
"postcss" |
||||
|
] |
||||
|
} |
||||
@ -1,14 +0,0 @@ |
|||||
import Vue from "vue"; |
|
||||
import { VaguerComponents } from "./src"; |
|
||||
import "./dist/style.css" |
|
||||
|
|
||||
Vue.use(VaguerComponents); |
|
||||
|
|
||||
const app = new Vue({ |
|
||||
methods: { |
|
||||
handleClick() { |
|
||||
alert("222"); |
|
||||
}, |
|
||||
}, |
|
||||
}); |
|
||||
app.$mount("#app"); |
|
||||
@ -0,0 +1,11 @@ |
|||||
|
export default { |
||||
|
base: "", |
||||
|
title: 'fake-art', |
||||
|
plugins: ['demo-container'], |
||||
|
themeConfig: { |
||||
|
nav: [ |
||||
|
{ text: 'Home', link: '/' } |
||||
|
], |
||||
|
sidebar: {} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,8 @@ |
|||||
|
import { FakeComponents } from "fake-art" |
||||
|
import "fake-art/dist/style.css" |
||||
|
|
||||
|
export default ({ |
||||
|
Vue, |
||||
|
}) => { |
||||
|
Vue.use(FakeComponents) |
||||
|
} |
||||
@ -0,0 +1,29 @@ |
|||||
|
# Hello fake-art |
||||
|
|
||||
|
Vue2组件展示 |
||||
|
|
||||
|
::: demo 此处放置代码示例的描述信息,支持 `Markdown` 语法,**描述信息只支持单行** |
||||
|
```html |
||||
|
<template> |
||||
|
<div class="red-center-text"> |
||||
|
<FakeButton>{{ message }}</FakeButton> |
||||
|
<input v-model="message" placeholder="Input something..."/> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
message: 'Hello Vue' |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style> |
||||
|
.red-center-text { |
||||
|
color: #ff7875; |
||||
|
text-align: center; |
||||
|
} |
||||
|
</style> |
||||
|
``` |
||||
|
::: |
||||
@ -0,0 +1,29 @@ |
|||||
|
# Hello VuePressasd |
||||
|
|
||||
|
组件展示 |
||||
|
|
||||
|
::: demo 此处放置代码示例的描述信息,支持 `Markdown` 语法,**描述信息只支持单行** |
||||
|
```html |
||||
|
<template> |
||||
|
<div class="red-center-text"> |
||||
|
<FakeButton>{{ message }}</FakeButton> |
||||
|
<input v-model="message" placeholder="Input something..."/> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
message: 'Hello Vue' |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style> |
||||
|
.red-center-text { |
||||
|
color: #ff7875; |
||||
|
text-align: center; |
||||
|
} |
||||
|
</style> |
||||
|
``` |
||||
|
::: |
||||
@ -0,0 +1 @@ |
|||||
|
fuck |
||||
@ -0,0 +1 @@ |
|||||
|
# sda |
||||
@ -0,0 +1,23 @@ |
|||||
|
import antfu from "@antfu/eslint-config" |
||||
|
|
||||
|
export default antfu({ |
||||
|
ignores: [ |
||||
|
"dist", |
||||
|
"docs", |
||||
|
], |
||||
|
typescript: true, |
||||
|
formatters: true, |
||||
|
yaml: false, |
||||
|
type: "lib", |
||||
|
stylistic: { |
||||
|
indent: 4, |
||||
|
quotes: "double", |
||||
|
}, |
||||
|
vue: { |
||||
|
sfcBlocks: true, |
||||
|
vueVersion: 2, |
||||
|
}, |
||||
|
rules: { |
||||
|
"node/prefer-global/process": "off", |
||||
|
}, |
||||
|
}) |
||||
@ -1,14 +0,0 @@ |
|||||
<!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"> |
|
||||
<vaguer-button @click.native="handleClick">aa</vaguer-button> |
|
||||
</div> |
|
||||
<script type="module" src="/dev.ts"></script> |
|
||||
</body> |
|
||||
</html> |
|
||||
@ -0,0 +1,6 @@ |
|||||
|
pre-push: |
||||
|
parallel: true |
||||
|
pre-commit: |
||||
|
jobs: |
||||
|
- name: check code |
||||
|
run: npx eslint . |
||||
@ -0,0 +1,24 @@ |
|||||
|
import type { Component } from "vue" |
||||
|
import Vue from "vue" |
||||
|
import { FakeComponents } from "../src" |
||||
|
import Layout from "./layout.vue" |
||||
|
|
||||
|
Vue.use(FakeComponents); |
||||
|
|
||||
|
(async () => { |
||||
|
// @ts-expect-error 由于@somebuild/build-component-vue2没有导出vite的类型导致glob无法识别,暂时忽略
|
||||
|
const apps = import.meta.glob("./src/**/*.vue") |
||||
|
const name = location.pathname.replace(/^\//, "") || "App" |
||||
|
const file = apps[`./src/${name}.vue`] |
||||
|
if (!file) { |
||||
|
location.pathname = "App" |
||||
|
return |
||||
|
} |
||||
|
|
||||
|
const App = ((await file()) as { default: Component }).default |
||||
|
const app = new Vue({ |
||||
|
render: h => h(Layout, {}, [h(App)]), |
||||
|
}) |
||||
|
|
||||
|
app.$mount("#app") |
||||
|
})() |
||||
@ -0,0 +1,24 @@ |
|||||
|
<!doctype html> |
||||
|
<html lang="en"> |
||||
|
<head> |
||||
|
<meta charset="UTF-8" /> |
||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
||||
|
<title>Playground</title> |
||||
|
<style> |
||||
|
html, |
||||
|
body, |
||||
|
#app { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
} |
||||
|
</style> |
||||
|
</head> |
||||
|
|
||||
|
<body> |
||||
|
<div id="app"></div> |
||||
|
<script type="module" src="/dev.ts"></script> |
||||
|
</body> |
||||
|
</html> |
||||
@ -0,0 +1,16 @@ |
|||||
|
<template> |
||||
|
<div class="layout-container"> |
||||
|
<slot /> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<style scoped> |
||||
|
.layout-container { |
||||
|
max-width: 1200px; |
||||
|
margin: 0 auto; |
||||
|
padding: 20px; |
||||
|
background-color: #f8f9fa; |
||||
|
border-radius: 8px; |
||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,5 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<FakeButton>123</FakeButton> |
||||
|
</div> |
||||
|
</template> |
||||
File diff suppressed because it is too large
@ -1 +1,3 @@ |
|||||
https://github.com/wheatjs/vaguer |
https://github.com/wheatjs/vaguer |
||||
|
https://v1.vuepress.vuejs.org/zh/ |
||||
|
https://docs.chenjianhui.site/vuepress-plugin-demo-container/zh/complex.html#todomvc-%E7%A4%BA%E4%BE%8B |
||||
|
|||||
@ -1,10 +1,10 @@ |
|||||
import ghpages from "gh-pages"; |
import ghpages from "gh-pages" |
||||
|
|
||||
ghpages.publish( |
ghpages.publish( |
||||
".", |
"docs/\.vuepress/dist", |
||||
{ dotfiles: true, branch: "published", src: ["package.json", "dist/**/*"] }, |
{ dotfiles: true, branch: "published" }, |
||||
function (err) { |
).then(() => { |
||||
if (err) throw err; |
console.log("success") |
||||
console.log("success"); |
}).catch((err) => { |
||||
} |
console.error(err) |
||||
); |
}) |
||||
|
|||||
@ -0,0 +1,21 @@ |
|||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
a: 123, |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<template> |
||||
|
<button class="fake-button"> |
||||
|
<slot /> |
||||
|
</button> |
||||
|
</template> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
.fake-button { |
||||
|
color: red; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,6 @@ |
|||||
|
import FakeButton from "./FakeButton.vue" |
||||
|
|
||||
|
export { |
||||
|
FakeButton, |
||||
|
} |
||||
|
export default FakeButton |
||||
@ -1,22 +0,0 @@ |
|||||
|
|
||||
<script> |
|
||||
export default { |
|
||||
data(){ |
|
||||
return { |
|
||||
a: 123 |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<template> |
|
||||
<button class="vaguer-button"> |
|
||||
<slot />-{{ a }} |
|
||||
</button> |
|
||||
</template> |
|
||||
|
|
||||
<style lang="scss"> |
|
||||
.vaguer-button { |
|
||||
color: red; |
|
||||
} |
|
||||
</style> |
|
||||
@ -1,6 +0,0 @@ |
|||||
import VaguerButton from "./VaguerButton.vue" |
|
||||
|
|
||||
export { |
|
||||
VaguerButton |
|
||||
} |
|
||||
export default VaguerButton |
|
||||
@ -1,14 +1,15 @@ |
|||||
import type { PluginObject } from "vue"; |
import type { PluginObject } from "vue" |
||||
|
|
||||
import * as components from "./components"; |
import * as components from "./components" |
||||
export default components; |
|
||||
|
|
||||
export const VaguerComponents: PluginObject<{}> = { |
export default components |
||||
|
|
||||
|
export const FakeComponents: PluginObject<object> = { |
||||
install(app) { |
install(app) { |
||||
Object.entries(components).forEach(([key, value]: [string, any]) => { |
Object.entries(components).forEach(([key, value]: [string, any]) => { |
||||
app.component(key, value); |
app.component(key, value) |
||||
}); |
}) |
||||
}, |
}, |
||||
}; |
} |
||||
|
|
||||
export { default as VaguerButton } from "./components/VaguerButton"; |
export { default as FakeButton } from "./components/FakeButton" |
||||
|
|||||
@ -1,5 +1,6 @@ |
|||||
declare module '*.vue' { |
declare module "*.vue" { |
||||
import { DefineComponent } from 'vue' |
import type { Component } from "vue" |
||||
const component: DefineComponent<{}, {}, any> |
|
||||
|
const component: Component |
||||
export default component |
export default component |
||||
} |
} |
||||
|
|||||
@ -1,13 +1,15 @@ |
|||||
{ |
{ |
||||
"compilerOptions": { |
"compilerOptions": { |
||||
|
"baseUrl": ".", |
||||
"module": "ESNext", |
"module": "ESNext", |
||||
"moduleResolution": "Bundler", |
"moduleResolution": "Bundler", |
||||
"resolveJsonModule": true, |
|
||||
"esModuleInterop": true, |
|
||||
"baseUrl": ".", |
|
||||
"paths": { |
"paths": { |
||||
"@/*": ["./src/*"] |
"fake-art": ["./src/index.ts"], |
||||
} |
"fake-art/*": ["./src/*"] |
||||
|
}, |
||||
|
"resolveJsonModule": true, |
||||
|
"esModuleInterop": true |
||||
}, |
}, |
||||
"exclude": ["node_modules", ".output"] |
"include": ["src", "playground"], |
||||
|
"exclude": ["node_modules", "dist"] |
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue