✨(component): update
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@layui/layui-vue",
|
||||
"version": "1.3.11",
|
||||
"version": "1.3.12-alpha.2",
|
||||
"author": "就眠儀式",
|
||||
"license": "MIT",
|
||||
"description": "a component library for Vue 3 base on layui-vue",
|
||||
@@ -34,7 +34,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@layui/icons-vue": "^1.0.9",
|
||||
"@layui/layer-vue": "^1.4.1",
|
||||
"@layui/layer-vue": "^1.4.2",
|
||||
"@vueuse/core": "^8.7.3",
|
||||
"async-validator": "^4.1.1",
|
||||
"cropperjs": "^1.5.12",
|
||||
|
||||
@@ -45,7 +45,7 @@ const isActive = computed({
|
||||
},
|
||||
});
|
||||
|
||||
const handleClick = function () {
|
||||
const handleClick = () => {
|
||||
if (!props.disabled) {
|
||||
isActive.value = !isActive.value;
|
||||
}
|
||||
@@ -53,9 +53,7 @@ const handleClick = function () {
|
||||
|
||||
const styles = computed(() => {
|
||||
return {
|
||||
"background-color": isActive.value
|
||||
? props.onswitchColor
|
||||
: props.unswitchColor,
|
||||
"background-color": isActive.value ? props.onswitchColor : props.unswitchColor,
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -80,7 +80,6 @@ const slots = slot.default && slot.default();
|
||||
const allChecked = ref(false);
|
||||
const hasChecked = ref(false);
|
||||
const tableDataSource = ref<any[]>([...props.dataSource]);
|
||||
const tableSelectedKeys = ref<Recordable[]>([...props.selectedKeys]);
|
||||
const tableColumns = ref([...props.columns]);
|
||||
const tableColumnKeys = ref(
|
||||
props.columns.map((item: any) => {
|
||||
@@ -90,6 +89,12 @@ const tableColumnKeys = ref(
|
||||
})
|
||||
);
|
||||
|
||||
const tableSelectedKeys = ref<Recordable[]>([...props.selectedKeys]);
|
||||
|
||||
watch(() => props.selectedKeys, () => {
|
||||
tableSelectedKeys.value = props.selectedKeys;
|
||||
},{deep: true})
|
||||
|
||||
const tableSelectedKey: WritableComputedRef<Recordable[]> = computed({
|
||||
get() {
|
||||
return props.selectedKey;
|
||||
|
||||
@@ -685,7 +685,8 @@ export default {
|
||||
::: demo 通过 `columns` 配置 `type:'checkbox'` 开启单选列。
|
||||
|
||||
<template>
|
||||
<lay-table :columns="columns23" :data-source="dataSource23"></lay-table>
|
||||
<lay-button @click="changeSelectedKeys">修改选中值 {{ selectedKeys5 }}</lay-button>
|
||||
<lay-table :columns="columns23" :data-source="dataSource23" v-model:selectedKeys="selectedKeys5"></lay-table>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -694,6 +695,12 @@ import { ref } from 'vue'
|
||||
export default {
|
||||
setup() {
|
||||
|
||||
const selectedKeys5 = ref(["1"]);
|
||||
|
||||
const changeSelectedKeys = () => {
|
||||
selectedKeys5.value = ["2"]
|
||||
}
|
||||
|
||||
const columns23 = [
|
||||
{
|
||||
type: "checkbox",
|
||||
@@ -732,6 +739,8 @@ export default {
|
||||
return {
|
||||
columns23,
|
||||
dataSource23,
|
||||
selectedKeys5,
|
||||
changeSelectedKeys
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1132,9 +1141,9 @@ export default {
|
||||
|
||||
::: table
|
||||
|
||||
| 插槽 | 描述 | 参数 |
|
||||
| 插槽 | 描述 | 参数 |
|
||||
| ------- | ------------ | ---- |
|
||||
| toolbar | 自定义工具栏 | -- |
|
||||
| toolbar | 自定义工具栏 | -- |
|
||||
|
||||
:::
|
||||
|
||||
|
||||
@@ -88,10 +88,10 @@ body {
|
||||
|
||||
.version {
|
||||
position: absolute;
|
||||
right: 16%;
|
||||
color: rgba(255, 255, 255, 0.8) !important;
|
||||
line-height: 60px;
|
||||
color: white;
|
||||
font-size: 15px;
|
||||
right: 16%;
|
||||
}
|
||||
|
||||
.alone-banner img {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@layui/layer-vue",
|
||||
"version": "1.4.1",
|
||||
"version": "1.4.2",
|
||||
"description": "a component library for Vue 3 base on layui-vue",
|
||||
"homepage": "http://www.layui-vue.com",
|
||||
"module": "lib/layer-vue.es.js",
|
||||
|
||||
Reference in New Issue
Block a user