Commit ef666dba authored by 周远喜's avatar 周远喜

ok

parent 1586601e
<template> <template>
<ul class="actions"> <div class="actions">
<li class="item" v-for="(li, i) in items" @click="detail(li)"> <div
:class="li.confirm ? 'confirm' : 'item'"
v-for="(li, i) in items"
@click="detail(li)"
>
<span v-if="mode == 'text'" class="text" v-text="li.label"></span> <span v-if="mode == 'text'" class="text" v-text="li.label"></span>
<Tooltip v-if="mode == 'icon'" :content="li.label" <Tooltip v-if="mode == 'icon'" :content="li.label"
><Icon :type="li.icon" ><Icon :type="li.icon"
...@@ -9,8 +13,8 @@ ...@@ -9,8 +13,8 @@
<Icon type="li.icon" /> <Icon type="li.icon" />
<span class="text" v-text="li.label"></span> <span class="text" v-text="li.label"></span>
</div> </div>
</li> </div>
</ul> </div>
</template> </template>
<script> <script>
...@@ -29,9 +33,14 @@ export default { ...@@ -29,9 +33,14 @@ export default {
return [ return [
{ label: "复制", icon: "md-copy", vclick: "" }, { label: "复制", icon: "md-copy", vclick: "" },
{ label: "新增", icon: "md-add", vclick: "" }, { label: "新增", icon: "md-add", vclick: "" },
{ label: "删除", icon: "md-trash", vclick: "" }, { label: "删除", icon: "md-trash", vclick: "", confirm: true },
{ label: "移动", icon: "md-move", vclick: "" }, { label: "移动", icon: "md-move", vclick: "" },
{ label: "派发", icon: "ios-alarm", vclick: "" }, {
label: "派发",
icon: "ios-alarm",
vclick: "",
confirm: "确认要进行派发吗?",
},
]; ];
}, },
}, },
...@@ -77,17 +86,32 @@ export default { ...@@ -77,17 +86,32 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
@size:20px;//按钮大小
@distince:5px;//按钮间距
@color:black;//主色
@color-hover:#106ffe;//主悬浮色
@color-confirm:red;// 二次确认色
.actions { .actions {
ul { display: inline-block;
li { .item,
float: left; .confirm {
list-style: none; display: inline-block;
width: 20px; list-style: none;
height: 20px; width: @size;
text-align: center; height: @size;
margin-left: 5px; text-align: center;
color: red; margin-left:@distince;
} cursor: pointer;
border: 1px dotted @color;
line-height: @size;
}
.item:hover {
border: 1px solid @color-hover;
color: @color-hover;
}
.confirm:hover {
border: 1px solid @color-confirm;
color: @color-confirm;
} }
} }
</style> </style>
\ No newline at end of file
...@@ -79,18 +79,19 @@ export default { ...@@ -79,18 +79,19 @@ export default {
key: "action", key: "action",
width: 150, width: 150,
align: "center", align: "center",
// render:(h,params)=>{ render:(h,params)=>{
// return h("Actions" return h("Actions"
// ,{ ,{
// attrs:{ attrs:{
// row:params, row:params,
// },
// on:{ },
// 'on-click':()=>this.rowclick on:{
// } 'on-click':this.rowclick
// } }
// ) }
// } )
}
// render: (h, params) => { // render: (h, params) => {
// return h("div", { class: "action" }, [ // return h("div", { class: "action" }, [
// h( // h(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment