feat: windicss

This commit is contained in:
winixt 2021-11-18 10:31:01 +08:00
parent 895e47c857
commit 5747466c43
7 changed files with 72 additions and 7 deletions

View File

@ -61,6 +61,7 @@ export const en: SidebarConfig = {
'/reference/plugin/plugins/request.md', '/reference/plugin/plugins/request.md',
'/reference/plugin/plugins/vuex.md', '/reference/plugin/plugins/vuex.md',
'/reference/plugin/plugins/qiankun.md', '/reference/plugin/plugins/qiankun.md',
'/reference/plugin/plugins/windicss.md',
'/reference/plugin/plugins/sass.md', '/reference/plugin/plugins/sass.md',
'/reference/plugin/plugins/editor.md', '/reference/plugin/plugins/editor.md',
], ],

View File

@ -61,6 +61,7 @@ export const zh: SidebarConfig = {
'/zh/reference/plugin/plugins/request.md', '/zh/reference/plugin/plugins/request.md',
'/zh/reference/plugin/plugins/vuex.md', '/zh/reference/plugin/plugins/vuex.md',
'/zh/reference/plugin/plugins/qiankun.md', '/zh/reference/plugin/plugins/qiankun.md',
'/zh/reference/plugin/plugins/windicss.md',
'/zh/reference/plugin/plugins/sass.md', '/zh/reference/plugin/plugins/sass.md',
'/zh/reference/plugin/plugins/editor.md', '/zh/reference/plugin/plugins/editor.md',
], ],

View File

@ -0,0 +1,28 @@
# @fesjs/plugin-windicss
## 介绍
`windicss` 支持
## 启用方式
`package.json` 中引入依赖:
```json
{
"devDependencies": {
"@fesjs/plugin-windicss": "^2.0.0"
},
}
```
## 配置
`.fes.js` 配置文件中添加自定义配置,详细配置[请看](https://windicss.org/integrations/webpack.html)
```
{
windicss: {
root: './',
}
}
```

View File

@ -0,0 +1,28 @@
# @fesjs/plugin-windicss
## 介绍
`windicss` 支持
## 启用方式
`package.json` 中引入依赖:
```json
{
"devDependencies": {
"@fesjs/plugin-windicss": "^2.0.0"
},
}
```
## 配置
`.fes.js` 配置文件中添加自定义配置,详细配置[请看](https://windicss.org/integrations/webpack.html)
```js
export default {
windicss: {
root: './',
}
}
```

View File

@ -1,9 +1,11 @@
import WindiCSSWebpackPlugin from 'windicss-webpack-plugin'; import WindiCSSWebpackPlugin from 'windicss-webpack-plugin';
import { resolve } from 'path';
export default (api) => { export default (api) => {
api.describe({ api.describe({
key: 'windi', key: 'windicss',
config: { config: {
default: {} default: {}
} }
@ -12,7 +14,12 @@ export default (api) => {
api.addEntryImportsAhead(() => [{ source: 'windi.css' }]); api.addEntryImportsAhead(() => [{ source: 'windi.css' }]);
api.chainWebpack((memo) => { api.chainWebpack((memo) => {
memo.plugin('windicss').before('vue-loader-plugin').use(WindiCSSWebpackPlugin); memo.plugin('windicss').before('vue-loader-plugin').use(WindiCSSWebpackPlugin, [
{
config: resolve(__dirname, '../windi.config.js'),
...api.config.windicss
}
]);
return memo; return memo;
}); });
}; };

View File

@ -2,7 +2,7 @@
<div :class="$style.red"> <div :class="$style.red">
<a-input placeholder="请输入。。。" /> <a-input placeholder="请输入。。。" />
<a-button type="primary">Primary</a-button> <a-button type="primary">Primary</a-button>
<div>国际化 {{t("test")}}</div> <div class="m-2">国际化 {{t("test")}}</div>
fes & 拉夫德鲁 <br /> fes & 拉夫德鲁 <br />
<access :id="accessId"> accessOnepicess1 <input /> </access> <access :id="accessId"> accessOnepicess1 <input /> </access>
<div v-access="accessId"> accessOnepicess2 <input /> </div> <div v-access="accessId"> accessOnepicess2 <input /> </div>
@ -29,10 +29,7 @@ import { Button, Input } from 'ant-design-vue';
export default { export default {
components: { components: {
[Button.name]: Button, [Button.name]: Button,
[Input.name]: Input, [Input.name]: Input
},
mounted(){
console.log("$style:", this.$style)
}, },
setup() { setup() {
const fes = ref('fes upgrade to vue3'); const fes = ref('fes upgrade to vue3');
@ -129,6 +126,9 @@ export default {
enumsGet: enums.get, enumsGet: enums.get,
roles roles
}; };
},
mounted() {
console.log('$style:', this.$style);
} }
}; };
</script> </script>