`

前端vue开发

 
阅读更多

1、首先组件大全,参考http://element.eleme.io/#/zh-CN/component/dialog

2、有几个主要概念,首先是数据双向绑定,也就是,你在页面或者js更新数据,会互相通知。

3、js定义

define([ 'js/index' ], function(a) {
	new Vue({
		el : '#root',
		data : {
		},
		methods : {
			handle : function() {
				var self = this;//
				this.list();
			},
		}


	});

 4、假如开发一个更新功能(列表的一行),可在页面通过edit(scope.row)来获取该列元素,你可以将该列赋值给一个隐藏域(弹出框)的对象,然后将隐藏域展示出来。

5、列表页,跳转到edit编辑页,可通过window.location.search来找到http链接后面跟着的参数值。

#打断点会发现该值为
?id=123456

6、

7、列表展示一般使用<el-table-column prop="name" label="名字" width="180px" align="center"></el-table-column>即可,但是如果是类型type,你总不能写个数字给用户看吧?这时候就需要if语句定制化显示,如下代码。同理,图片也是如此:

            	<template slot-scope="scope">
            	            	<span v-if='scope.row.type==0'>关闭</span>
            	            	<span v-if='scope.row.type==1'>开启</span>
            	</template>
            	<template slot-scope="scope">
            	            	<img style="width: 100px; height: 100px" :src="scope.row.img" />
            	</template>

 8、前端传数组给后端时,例如ids:[],后端接收需要用@RequestParam("ids[]"),其中“[]”不可以省略。

 

 

以此类推

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics