-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from d2-projects/master
update
- Loading branch information
Showing
24 changed files
with
951 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<template> | ||
<div style="cursor: pointer"> | ||
<el-tag :type="type" @click.native="handleClick">{{ text }}</el-tag> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
value: { | ||
type: Boolean, | ||
require: true | ||
} | ||
}, | ||
computed: { | ||
type () { | ||
return this.value ? 'success' : 'danger' | ||
}, | ||
text () { | ||
return this.value ? '是' : '否' | ||
} | ||
}, | ||
methods: { | ||
handleClick () { | ||
this.$emit('input', !this.value) | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
export default `<template> | ||
<div style="cursor: pointer"> | ||
<el-tag :type="type" @click.native="handleClick">{{ text }}</el-tag> | ||
</div> | ||
</template> | ||
<script> | ||
export default { | ||
props: { | ||
value: { | ||
type: Boolean, | ||
require: true | ||
} | ||
}, | ||
computed: { | ||
type () { | ||
return this.value ? 'success' : 'danger' | ||
}, | ||
text () { | ||
return this.value ? '是' : '否' | ||
} | ||
}, | ||
methods: { | ||
handleClick () { | ||
this.$emit('input', !this.value) | ||
} | ||
} | ||
} | ||
</script>` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
export default `<template> | ||
<div> | ||
<d2-crud | ||
ref="d2Crud" | ||
:columns="columns" | ||
:data="data" | ||
@d2-data-change="handleDataChange"/> | ||
</div> | ||
</template> | ||
<script> | ||
export default { | ||
data () { | ||
return { | ||
columns: [ | ||
{ | ||
title: '日期', | ||
key: 'date', | ||
width: '180' | ||
}, | ||
{ | ||
title: '姓名', | ||
key: 'name', | ||
width: '180' | ||
}, | ||
{ | ||
title: '地址', | ||
key: 'address' | ||
}, | ||
{ | ||
title: '检查状态(点击可修改)', | ||
key: 'check', | ||
component: { | ||
name: 'my-tag' | ||
} | ||
} | ||
], | ||
data: [ | ||
{ | ||
date: '2016-05-02', | ||
name: '王小虎', | ||
address: '上海市普陀区金沙江路 1518 弄', | ||
check: true | ||
}, | ||
{ | ||
date: '2016-05-04', | ||
name: '王小虎', | ||
address: '上海市普陀区金沙江路 1517 弄', | ||
check: false | ||
}, | ||
{ | ||
date: '2016-05-01', | ||
name: '王小虎', | ||
address: '上海市普陀区金沙江路 1519 弄', | ||
check: true | ||
}, | ||
{ | ||
date: '2016-05-03', | ||
name: '王小虎', | ||
address: '上海市普陀区金沙江路 1516 弄', | ||
check: true | ||
} | ||
] | ||
} | ||
}, | ||
methods: { | ||
handleDataChange (data) { | ||
console.log(data) | ||
} | ||
} | ||
} | ||
</script>` |
Oops, something went wrong.