merge package.json

This commit is contained in:
songwanli2025@163.com 2019-08-01 16:04:25 +08:00
commit 2aa0fca32e
3 changed files with 90 additions and 6 deletions

View File

@ -38,6 +38,16 @@
</div> </div>
</n-scrollbar> </n-scrollbar>
</div> </div>
<div style="width: 400px;">
<n-scrollbar>
<n-advance-table
:columns="columns"
:data="data"
max-height="300px"
:on-change="onChange"
/>
</n-scrollbar>
</div>
<!--EXAMPLE_END--> <!--EXAMPLE_END-->
</div> </div>
<pre class="n-doc-section__inspect">Inspect some value here</pre> <pre class="n-doc-section__inspect">Inspect some value here</pre>
@ -50,8 +60,82 @@
<script> <script>
export default { export default {
data () { data () {
let d = new Array(20).fill(0)
d = d.map((item, idx) => {
return {
name: 'xiaobai' + idx,
age: 10 + Math.ceil(Math.random() * 10)
}
})
console.log(d)
return { return {
columns: [
{
title: 'Name',
key: 'name',
filterMultiple: false,
filterItems: [{
label: 'xiaobai1',
value: 'xiaobai1'
}],
onFilter: 'custom'
},
{
title: 'Age',
key: 'age',
sortable: true,
order: 1, //
sorter: (a, b) => {
// soter sorter
return a.age - b.age
},
filterMultiple: true, // onFilter
filterItems: [{
label: '14',
value: 14
}, {
label: '15',
value: 15
}],
onFilter: (value, record) => {
return value.includes(record.age)
// switch (value) {
// case 14:
// return record.age <= value
// case 15:
// return record.age >= value
// }
},
render: (h, params) => {
return <b>{params.row.age}</b>
}
},
{
title: '#',
render: (h, params) => {
return (
<n-button
style="margin:0;"
size="small"
onClick={() => this.handleClick(params)}
>
delete
</n-button>
)
}
}
],
data: d
} }
},
methods: {
handleClick (params) {
alert('delete' + JSON.stringify(params))
},
onChange (...args) {
console.log(args)
}
} }
} }
</script> </script>

View File

@ -1,6 +1,6 @@
{ {
"name": "naive-ui", "name": "naive-ui",
"version": "0.2.61", "version": "0.2.67",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -52,11 +52,11 @@
} }
.n-scrollbar-content { .n-scrollbar-content {
width: max-content; width: fit-content;
overflow: visible; overflow: visible;
min-width: 100%; min-width: 100%;
width: intrinsic; /* Safari/WebKit uses a non-standard name */ /* stylelint-disable */
width: -moz-max-content; /* Firefox/Gecko */ width: -moz-fit-content; /* Firefox/Gecko */
width: -webkit-max-content; /* Chrome */ width: -webkit-fit-content; /* Chrome */
width: max-content; /* stylelint-enable */
} }