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",
|
"name": "russia-block",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"vue": "^3.2.25"
|
"@element-plus/icons": "^0.0.11",
|
||||||
},
|
"axios": "^0.26.1",
|
||||||
"devDependencies": {
|
"dayjs": "^1.11.0",
|
||||||
"@originjs/vite-plugin-global-style": "^1.0.2",
|
"element-plus": "^2.1.2",
|
||||||
"@types/node": "^17.0.21",
|
"lodash": "^4.17.21",
|
||||||
"@vitejs/plugin-legacy": "^1.7.1",
|
"qs": "^6.10.3",
|
||||||
"@vitejs/plugin-vue": "^2.2.0",
|
"sortablejs": "^1.14.0",
|
||||||
"@vitejs/plugin-vue-jsx": "^1.3.8",
|
"vue": "^3.2.25",
|
||||||
"consola": "^2.15.3",
|
"vue-router": "^4.0.14",
|
||||||
"less": "^4.1.2",
|
"vuex": "^4.0.2"
|
||||||
"unplugin-auto-import": "^0.6.4",
|
},
|
||||||
"unplugin-vue-components": "^0.18.0",
|
"devDependencies": {
|
||||||
"vite": "^2.8.0",
|
"@originjs/vite-plugin-global-style": "^1.0.2",
|
||||||
"vite-plugin-remove-console": "^0.0.6",
|
"@types/node": "^17.0.21",
|
||||||
"vite-plugin-style-import": "^2.0.0",
|
"@vitejs/plugin-legacy": "^1.7.1",
|
||||||
"vite-plugin-svg-icons": "^2.0.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 { createApp } from 'vue';
|
||||||
import App from './App.vue';
|
import App from './App.vue';
|
||||||
|
|
||||||
import 'virtual:svg-icons-register';
|
import '@/icons';
|
||||||
|
|
||||||
createApp(App).mount('#app');
|
createApp(App).mount('#app');
|
||||||
|
Loading…
Reference in new issue