Skip to content

Commit

Permalink
docs: 组件文档 demo 代码走查修改 (#2459)
Browse files Browse the repository at this point in the history
  • Loading branch information
eiinu authored Jul 27, 2023
1 parent f7b9440 commit a3965f2
Show file tree
Hide file tree
Showing 56 changed files with 1,878 additions and 2,688 deletions.
37 changes: 26 additions & 11 deletions src/packages/__VUE/address/doc.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ app.use(Address);
const onChange = (cal) => {
const name = address[cal.next];
if (name.length < 1) {
if (!name || name.length < 1) {
showPopup.value = false;
}
};
Expand Down Expand Up @@ -101,14 +101,14 @@ If you want to select a province, you need to set the region ID in the order of
@change="onChange"
@close="close"
custom-address-title="Choose City"
:columns-placeholder="placeholder"
></nut-address>
</template>
<script>
import { ref, reactive, toRefs } from 'vue';
export default {
setup() {
const showPopup = ref(false);
const value = ref([1, 7, 3]);
const address = reactive({
province: [
{ id: 1, name: '北京' },
Expand All @@ -131,20 +131,18 @@ If you want to select a province, you need to set the region ID in the order of
});
const text = ref('Balizhuang Street, Chaoyang District, Beijing');
const value = ref([1, 7, 3]);
const showAddress = () => {
showPopup.value = !showPopup.value;
};
const onChange = (cal) => {
const name = address[cal.next];
if (name.length < 1) {
if (!name || name.length < 1) {
showPopup.value = false;
}
};
const close = (val) => {
console.log(val);
text.value = val.data.addressStr;
value.value = [val.data.province.id, val.data.city.id, val.data.country.id];
};
Expand Down Expand Up @@ -215,7 +213,7 @@ If you want to select a province, you need to set the region ID in the order of
const onChange = (cal) => {
const name = address[cal.next];
if (name.length < 1) {
if (!name || name.length < 1) {
showPopup.value = false;
}
};
Expand Down Expand Up @@ -328,10 +326,9 @@ If you want to select a province, you need to set the region ID in the order of
<nut-address
v-model:visible="showPopupCustomImg"
type="exist"
:existAddress="existAddress"
:exist-address="existAddress"
@close="close"
:is-show-custom-address="false"
@selected="selected3"
>
<template #unselected-icon>
<Heart1 style="margin-right:8px"></Heart1>
Expand Down Expand Up @@ -409,10 +406,29 @@ If you want to select a province, you need to set the region ID in the order of
console.log(nowExistAdd);
};
return { showPopupCustomImg, existAddress, text, showCustomImg, close, selected, ...toRefs(icon) };
return { showPopupCustomImg, existAddress, text, showCustomImg, close, selected };
}
};
</script>
<style>
.nut-address-custom-buttom {
width: 100%;
height: 54px;
padding: 6px 0px 0;
border-top: 1px solid #f2f2f2;
}
.btn {
width: 90%;
height: 42px;
line-height: 42px;
margin: auto;
text-align: center;
background: linear-gradient(135deg, #fa2c19 0%, #fa6419 100%);
border-radius: 21px;
font-size: 15px;
color: white;
}
</style>
```

:::
Expand Down Expand Up @@ -528,10 +544,9 @@ If you want to select a province, you need to set the region ID in the order of
console.log('点击了自定义地址左上角的返回按钮');
}
};
const onChange = (cal) => {
const name = address[cal.next];
if (name.length < 1) {
if (!name || name.length < 1) {
showPopupOther.value = false;
}
};
Expand Down
3 changes: 0 additions & 3 deletions src/packages/__VUE/address/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ app.use(Address);
@change="onChange"
@close="close"
custom-address-title="请选择所在地区"
:columns-placeholder="placeholder"
></nut-address>
</template>
<script>
Expand Down Expand Up @@ -132,7 +131,6 @@ app.use(Address);
});
const text = ref('北京朝阳区八里庄街道');
const value = ref([1, 7, 3]);
const showAddress = () => {
showPopup.value = !showPopup.value;
Expand Down Expand Up @@ -331,7 +329,6 @@ app.use(Address);
:exist-address="existAddress"
@close="close"
:is-show-custom-address="false"
@selected="selected3"
>
<template #unselected-icon>
<Heart1 style="margin-right:8px"></Heart1>
Expand Down
16 changes: 6 additions & 10 deletions src/packages/__VUE/address/doc.taro.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ app.use(Address);
town: []
});
const text = ref('请选择地址');
const text = ref('选择地址');
const showAddress = () => {
showPopup.value = !showPopup.value;
Expand Down Expand Up @@ -101,14 +101,14 @@ app.use(Address);
@change="onChange"
@close="close"
custom-address-title="请选择所在地区"
:columns-placeholder="placeholder"
></nut-address>
</template>
<script>
import { ref, reactive, toRefs } from 'vue';
export default {
setup() {
const showPopup = ref(false);
const value = ref([1, 7, 3]);
const address = reactive({
province: [
{ id: 1, name: '北京' },
Expand All @@ -131,7 +131,6 @@ app.use(Address);
});
const text = ref('北京朝阳区八里庄街道');
const value = ref([1, 7, 3]);
const showAddress = () => {
showPopup.value = !showPopup.value;
Expand Down Expand Up @@ -173,7 +172,6 @@ app.use(Address);
:town="town"
@change="onChange"
@close="close"
custom-address-title="请选择所在地区"
height="270px"
></nut-address>
</template>
Expand Down Expand Up @@ -290,7 +288,7 @@ app.use(Address);
}
]);
const text = ref('请选择地址');
const text = ref('选择地址');
const showAddressExist = () => {
showPopupExist.value = true;
Expand Down Expand Up @@ -328,10 +326,9 @@ app.use(Address);
<nut-address
v-model:visible="showPopupCustomImg"
type="exist"
:existAddress="existAddress"
:exist-address="existAddress"
@close="close"
:is-show-custom-address="false"
@selected="selected3"
>
<template #unselected-icon>
<Heart1 style="margin-right:8px"></Heart1>
Expand Down Expand Up @@ -389,7 +386,7 @@ app.use(Address);
}
]);
const text = ref('请选择地址');
const text = ref('选择地址');
const showCustomImg = () => {
showPopupCustomImg.value = true;
Expand Down Expand Up @@ -520,7 +517,7 @@ app.use(Address);
}
]);
const backBtnIcon = ref('left');
const text = ref('请选择地址');
const text = ref('选择地址');
const showAddressOther = () => {
showPopupOther.value = true;
Expand All @@ -547,7 +544,6 @@ app.use(Address);
console.log('点击了自定义地址左上角的返回按钮');
}
};
const onChange = (cal) => {
const name = address[cal.next];
if (!name || name.length < 1) {
Expand Down
1 change: 0 additions & 1 deletion src/packages/__VUE/addresslist/doc.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ app.use(AddressList);
clickItem,
delClick,
editClick,
setClick,
delClickSwipe,
addAddress,
dataOptions
Expand Down
1 change: 0 additions & 1 deletion src/packages/__VUE/addresslist/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ app.use(AddressList);
clickItem,
delClick,
editClick,
setClick,
delClickSwipe,
addAddress,
dataOptions
Expand Down
1 change: 0 additions & 1 deletion src/packages/__VUE/addresslist/doc.taro.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ app.use(AddressList);
clickItem,
delClick,
editClick,
setClick,
delClickSwipe,
addAddress,
dataOptions
Expand Down
Loading

0 comments on commit a3965f2

Please sign in to comment.