Comments (4)
https://codepen.io/QingWei-Li/pen/ozYpNA
你看我复制粘贴的都搞出来了
from element.
from element.
/webpack.config.js
var webpack = require('webpack');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var path = require('path');
module.exports = {
entry: {
app: './src/main.js',
vendors:['vue','vue-router','element-ui']
},
output: {
path: './build',
publicPath: '/build/',
filename: 'bundle.js'
},
module: {
loaders: [
{ test: /\.vue$/, loader: 'vue' },
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel'},
{ test: /\.css$/, loader: ExtractTextPlugin.extract("style-loader", "css-loader") },
{
test: /\.(eot|svg|ttf|woff|woff2|png)\w*/,
loader: 'file'
},
{ test: /\.less$/, loader: ExtractTextPlugin.extract("css-loader","less-loader") },
]
},
plugins: [new webpack.optimize.CommonsChunkPlugin('vendors', 'vendors.js'),
new ExtractTextPlugin("styles.css")],
devtool: '#source-map'
}
/src/main.js
import Vue from 'vue'
import Element from 'element-ui'
import 'element-ui/lib/theme-default/index.css'
Vue.use(Element)
Vue.config.debug = process.env.NODE_ENV !== 'production'
import app from './app.vue'
const App = new Vue({
el: 'body',
components: {
app
}
})
/src/app.vue
<template>
<el-form ref="form" :model="form" label-width="80px" @submit.prevent="onSubmit">
<el-form-item label="活动名称">
<el-input v-model="form.name"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary">立即创建</el-button>
<el-button @click.native.prevent>取消</el-button>
</el-form-item>
</el-form>
</template>
<script>
export default {
data() {
return {
form: {
name: '',
region: '',
date1: '',
date2: '',
delivery: false,
type: [],
resource: '',
desc: ''
}
}
},
methods: {
onSubmit() {
console.log('submit!');
}
}
}
</script>
/index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>title</title>
<meta name="description" content="title">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="./build/styles.css">
</head>
<body>
<!--[if lt IE 10]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<app></app>
<script src="./build/vendors.js"></script>
<script src="./build/bundle.js"></script>
</body>
</html>
from element.
这是给 Vue 2 用的不是给 Vue 1 啊... 如果不清楚 Vue 2 怎么写,请参考官方教程。或者我前面给的 demo
from element.
Related Issues (20)
- [Bug Report] 日期选择器type="week"时,Picker Options中设置disabledDate为昨天和firstDayOfWeek为1,点击4月1日日期选择器不作用
- [Bug Report] 多语言里繁体翻译不全
- 2.13.2版本的日期或者时间控件el-time-picker手动输入数字不会自动转时间格式 HOT 1
- [Feature Request] el-upload 如何实现取消上传后继续上传及已上传文件不移出列表?
- [Bug Report] el-body嵌套el-table只有两列时候第二列设置fixed后高度异常 HOT 1
- [Bug Report] form-item.vue validate source对象不能访问form model中的其他属性
- [Bug Report] el-table的展开行里面再放一个el-table,设置了fixed的el-table-column会显示异常
- [Feature Request] el-drawer打开想要点击页面其他元素,并且页面可以滚动
- [Bug Report] <el-time-picker is-range 时 时间范围联动限制时异常 HOT 1
- [Bug Report] Nested dialog boxes contain tables with checkbox properties set. Selecting a checkbox can cause Google Chrome to crash HOT 2
- [Bug Report] when messageBox‘s render function use a observable data, it can't update the ui HOT 1
- [Bug Report] cascader组件修改v-model值不触发lazyLoad
- [Bug Report] select组件给v-model赋值不触发远程搜索问题
- [Bug Report] 常用功能:tree组件的插槽内,应该暴露出来节点的索引, 引用即可复现,目前没有索引 HOT 2
- [Bug Report] el-cascader:panel中使用键盘向下选中数据,滚动异常
- 主题编辑功能报500了
- [Bug Report] 【el-table】 using <el-table> width <el-table-column type="selection" cell-class="testname">, the selection column is unindented
- [Bug Report] Element UI 官网的自定义主题模块 报错 Server Error 500 无法使用 HOT 3
- [Bug Report] 谷歌浏览器下,使用previewSrcList开启大图预览后,按钮样式有问题 HOT 2
- [Bug Report] el-tree中的check事件和check-change事件的顺序是不是反了
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from element.