重命名 docs 为 example

This commit is contained in:
就眠儀式 2021-11-23 11:08:40 +08:00
parent 97788e3a77
commit 4a4ee87b65
88 changed files with 14 additions and 7 deletions

View File

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -25,14 +25,13 @@
"layui",
"vue"
],
"author": "layui-vue",
"author": "就眠儀式",
"license": "MIT",
"peerDependencies": {
"vue": "^3.2.22",
"vue-router": "^4.0.12"
},
"dependencies": {
"@types/node": "^16.11.9",
"vue": "^3.2.22",
"vue-router": "^4.0.12"
},
@ -41,6 +40,7 @@
"@babel/preset-env": "^7.15.8",
"@babel/preset-typescript": "^7.15.0",
"@rollup/plugin-babel": "^5.3.0",
"@types/node": "^16.11.9",
"@types/markdown-it": "^12.2.3",
"@types/markdown-it-container": "^2.0.4",
"@vitejs/plugin-vue": "^1.9.3",

View File

@ -5,7 +5,7 @@ export default {
</script>
<script setup lang="ts">
import { defineProps } from "vue";
import { computed, defineProps } from "vue";
export interface LayIconProps {
prefix?: string;
@ -17,8 +17,15 @@ export interface LayIconProps {
const props = withDefaults(defineProps<LayIconProps>(), {
prefix: "layui-icon",
});
const styles = computed(() => {
return {
color: props.color,
fontSize: props.size,
};
});
</script>
<template>
<i :class="[prefix, type]" :style="{ color: color, fontSize: size }" />
<i :class="[prefix, type]" :style="styles" />
</template>

View File

@ -1,14 +1,14 @@
import path from 'path'
import { defineConfig } from 'vite'
import babel from '@rollup/plugin-babel'
import { name } from './package.json'
import plugins from './docs/src/plugin/common-plugins'
import babel from '@rollup/plugin-babel'
import plugins from './example/src/plugin/common-plugins'
const camelize = (name: string) =>
name.replace(/(^|-)(\w)/g, (a, b, c) => c.toUpperCase())
export default defineConfig({
root: path.resolve(__dirname, 'docs'),
root: path.resolve(__dirname, 'example'),
resolve: {
alias: {
'/@src': path.resolve(__dirname, 'src'),