Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
element-ui-for-gov
Advanced tools
npm install element-ui-for-gov -S
import Vue from 'vue'
import ElementUIForGov from 'element-ui-for-gov'
Vue.use(ElementUIForGov)
// or
import {
Select,
Button
// ...
} from 'element-ui-for-gov'
Vue.component(Select.name, Select)
Vue.component(Button.name, Button)
在 main.js 中写入以下内容:
import Vue from 'vue';
import ElementUIForGov from 'element-ui-for-gov';
import 'element-ui-for-gov/lib/theme-chalk/index.css';
import App from './App.vue';
Vue.use(ElementUIForGov);
new Vue({
el: '#app',
render: h => h(App)
});
以上代码便完成了 element-ui-for-gov 的引入。需要注意的是,样式文件需要单独引入。
借助 babel-plugin-component,我们可以只引入需要的组件,以达到减小项目体积的目的。
首先,安装 babel-plugin-component:
npm install babel-plugin-component -D
然后,将 .babelrc 修改为:
{
"presets": [["es2015", { "modules": false }]],
"plugins": [
[
"component",
{
"libraryName": "element-ui-for-gov",
"styleLibraryName": "theme-chalk"
}
]
]
}
接下来,如果你只希望引入部分组件,比如 Button 和 Select,那么需要在 main.js 中写入以下内容:
import Vue from 'vue';
import { Button, Select } from 'element-ui-for-gov';
import 'element-ui-for-gov/lib/theme-chalk/button.css';
import 'element-ui-for-gov/lib/theme-chalk/select.css';
import App from './App.vue';
Vue.component(Button.name, Button);
Vue.component(Select.name, Select);
/* 或写为
* Vue.use(Button)
* Vue.use(Select)
*/
new Vue({
el: '#app',
render: h => h(App)
});
至此,一个基于 Vue 和 Element-ui-for-gov 的开发环境已经搭建完毕,现在就可以编写代码了。各个组件的使用方法请参阅它们各自的文档。
现代浏览器和ie 10+.
project
│ ...
│
└───packages
│ │ button // 组件
│ │ input
│ │ ...
│ │
│ └───theme-chalk // 组件样式
│ │
│ └───src
│ │ button.scss
│ │ input.scss
│ │ ...
│
└───examples
│ ...
│
└───docs
│
└───zh-CN
│ button.md // 组件说明文档
│ input.md
│ ...
首先你需要 Node.js 4+,yarn 和 npm 3+。注意:我们使用 yarn 进行依赖版本的锁定,所以请不要使用 npm install
安装依赖。
npm run bootstrap
npm run dev
# open http://localhost:8085
提示:可以运行
npm run dev:play
,修改examples/play/index.vue
文件,调用你修改后的组件,仍然访问 http://localhost:8085,查看修改效果,更快更方便。
npm run new newComponentName
自动创建组件目录结构,包含入口文件、样式文件、文档npm run dist
FAQs
element-ui for gov
The npm package element-ui-for-gov receives a total of 482 weekly downloads. As such, element-ui-for-gov popularity was classified as not popular.
We found that element-ui-for-gov demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.