parent
5e535e0de0
commit
c8fca257b6
@ -0,0 +1,16 @@
|
||||
module.exports = {
|
||||
printWidth: 120,
|
||||
tabWidth: 4,
|
||||
useTabs: false,
|
||||
semi: true,
|
||||
singleQuote: true,
|
||||
quoteProps: 'as-needed',
|
||||
jsxSingleQuote: false,
|
||||
trailingComma: 'es5',
|
||||
bracketSpacing: true,
|
||||
bracketSameLine: false,
|
||||
arrowParens: 'always',
|
||||
htmlWhitespaceSensitivity: 'ignore',
|
||||
vueIndentScriptAndStyle: true,
|
||||
endOfLine: 'auto',
|
||||
};
|
@ -0,0 +1,13 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"moduleResolution": "Node",
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"@/*": ["src/*"]
|
||||
}
|
||||
},
|
||||
"exclude": ["node_modules"]
|
||||
}
|
@ -1,28 +1,37 @@
|
||||
{
|
||||
"name": "russia-block",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"vue": "^3.2.25"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@originjs/vite-plugin-global-style": "^1.0.2",
|
||||
"@types/node": "^17.0.21",
|
||||
"@vitejs/plugin-legacy": "^1.7.1",
|
||||
"@vitejs/plugin-vue": "^2.2.0",
|
||||
"@vitejs/plugin-vue-jsx": "^1.3.8",
|
||||
"consola": "^2.15.3",
|
||||
"less": "^4.1.2",
|
||||
"unplugin-auto-import": "^0.6.4",
|
||||
"unplugin-vue-components": "^0.18.0",
|
||||
"vite": "^2.8.0",
|
||||
"vite-plugin-remove-console": "^0.0.6",
|
||||
"vite-plugin-style-import": "^2.0.0",
|
||||
"vite-plugin-svg-icons": "^2.0.1"
|
||||
}
|
||||
"name": "russia-block",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@element-plus/icons": "^0.0.11",
|
||||
"axios": "^0.26.1",
|
||||
"dayjs": "^1.11.0",
|
||||
"element-plus": "^2.1.2",
|
||||
"lodash": "^4.17.21",
|
||||
"qs": "^6.10.3",
|
||||
"sortablejs": "^1.14.0",
|
||||
"vue": "^3.2.25",
|
||||
"vue-router": "^4.0.14",
|
||||
"vuex": "^4.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@originjs/vite-plugin-global-style": "^1.0.2",
|
||||
"@types/node": "^17.0.21",
|
||||
"@vitejs/plugin-legacy": "^1.7.1",
|
||||
"@vitejs/plugin-vue": "^2.2.0",
|
||||
"@vitejs/plugin-vue-jsx": "^1.3.8",
|
||||
"consola": "^2.15.3",
|
||||
"less": "^4.1.2",
|
||||
"unplugin-auto-import": "^0.6.4",
|
||||
"unplugin-vue-components": "^0.18.0",
|
||||
"vite": "^2.8.0",
|
||||
"vite-plugin-remove-console": "^0.0.6",
|
||||
"vite-plugin-style-import": "^2.0.0",
|
||||
"vite-plugin-svg-icons": "^2.0.1"
|
||||
}
|
||||
}
|
||||
|
@ -1,42 +0,0 @@
|
||||
<template>
|
||||
<svg class="svg-icon" aria-hidden="true">
|
||||
<use :href="symbolId" :fill="color" />
|
||||
</svg>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default defineComponent({
|
||||
name: 'SvgIcon',
|
||||
props: {
|
||||
prefix: {
|
||||
type: String,
|
||||
default: 'icon',
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: '#333',
|
||||
},
|
||||
size: {
|
||||
type: [Number, String],
|
||||
default: 16,
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
const symbolId = computed(() => `#${props.prefix}-${props.name}`);
|
||||
const size = computed(() =>
|
||||
typeof new Number(props.size) !== Number.NaN ? props.size + 'px' : props.size
|
||||
);
|
||||
return { symbolId, size };
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.svg-icon {
|
||||
width: v-bind(size);
|
||||
height: v-bind(size);
|
||||
}
|
||||
</style>
|
@ -0,0 +1,58 @@
|
||||
<template>
|
||||
<template v-if="name">
|
||||
<i v-if="isRemix" class="x-icon" :class="'x-icon-' + name" v-bind="{ ...$props, ...$attrs }"></i>
|
||||
<svg v-else-if="svg" class="x-icon" aria-hidden="true">
|
||||
<use :href="symbolId" :fill="color" />
|
||||
</svg>
|
||||
<el-icon v-else class="x-icon">
|
||||
<component :is="name" v-bind="{ ...$props, ...$attrs }" />
|
||||
</el-icon>
|
||||
</template>
|
||||
</template>
|
||||
<script>
|
||||
export default defineComponent({
|
||||
name: 'XIcon',
|
||||
props: {
|
||||
name: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
size: {
|
||||
type: [String, Number],
|
||||
default: 14,
|
||||
},
|
||||
svg: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: 'inherit',
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
const symbolId = computed(() => `#icon-${props.name}`);
|
||||
const size = computed(() =>
|
||||
typeof new Number(props.size) !== Number.NaN ? props.size + 'px' : props.size
|
||||
);
|
||||
const isRemix = computed(() => props.name.indexOf('-') !== -1 || props.isCustomSvg);
|
||||
return {
|
||||
symbolId,
|
||||
size,
|
||||
color: props.color,
|
||||
isRemix,
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.x-icon {
|
||||
font-size: v-bind(size);
|
||||
color: v-bind(color);
|
||||
}
|
||||
svg.x-icon {
|
||||
width: v-bind(size);
|
||||
height: v-bind(size);
|
||||
}
|
||||
</style>
|
@ -0,0 +1,2 @@
|
||||
import 'virtual:svg-icons-register';
|
||||
import '@/icons/remixicon.less';
|
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 1.1 MiB |
After Width: | Height: | Size: 877 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 200 B After Width: | Height: | Size: 200 B |
@ -0,0 +1,4 @@
|
||||
const fs = require('fs');
|
||||
let data = fs.readFileSync('./remixicon.less').toString();
|
||||
let res = data.match(/(?<=\.x-icon-).*?(?=:before)/g);
|
||||
fs.writeFileSync('index.json', JSON.stringify(res));
|
@ -1,6 +1,6 @@
|
||||
import { createApp } from 'vue';
|
||||
import App from './App.vue';
|
||||
|
||||
import 'virtual:svg-icons-register';
|
||||
import '@/icons';
|
||||
|
||||
createApp(App).mount('#app');
|
||||
|
Loading…
Reference in new issue