mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-08 01:17:23 +08:00
chore: update
This commit is contained in:
parent
db2b59ed51
commit
6b351d75c7
@ -34,11 +34,11 @@ const props = {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
/** 控件尺寸 */
|
/** 控件尺寸 */
|
||||||
size: {
|
size: {
|
||||||
type: String as PropType<"small" | "default" | "large">
|
type: String as PropType<"small" | "default" | "large">
|
||||||
},
|
},
|
||||||
/** 是否global禁用,默认false */
|
/** 是否全局禁用,默认 `false` */
|
||||||
disabled: {
|
disabled: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
@ -62,8 +62,7 @@ export default defineComponent({
|
|||||||
: ref(0);
|
: ref(0);
|
||||||
|
|
||||||
function handleChange({ option, index }, event: Event) {
|
function handleChange({ option, index }, event: Event) {
|
||||||
if (props.disabled) return;
|
if (props.disabled || option.disabled) return;
|
||||||
if (option.disabled) return;
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
isNumber(props.modelValue)
|
isNumber(props.modelValue)
|
||||||
? emit("update:modelValue", index)
|
? emit("update:modelValue", index)
|
||||||
@ -138,9 +137,10 @@ export default defineComponent({
|
|||||||
style={{
|
style={{
|
||||||
background:
|
background:
|
||||||
curMouseActive.value === index ? segmentedItembg.value : "",
|
curMouseActive.value === index ? segmentedItembg.value : "",
|
||||||
color:
|
color: props.disabled
|
||||||
!option.disabled &&
|
? null
|
||||||
(curIndex.value === index || curMouseActive.value === index)
|
: !option.disabled &&
|
||||||
|
(curIndex.value === index || curMouseActive.value === index)
|
||||||
? isDark.value
|
? isDark.value
|
||||||
? "rgba(255, 255, 255, 0.85)"
|
? "rgba(255, 255, 255, 0.85)"
|
||||||
: "rgba(0,0,0,.88)"
|
: "rgba(0,0,0,.88)"
|
||||||
|
@ -241,11 +241,7 @@ watch(size, val => (dynamicSize.value = size.value));
|
|||||||
<Segmented :options="optionsDisabled" :size="dynamicSize" />
|
<Segmented :options="optionsDisabled" :size="dynamicSize" />
|
||||||
<el-divider />
|
<el-divider />
|
||||||
<p class="mb-2">全局禁用</p>
|
<p class="mb-2">全局禁用</p>
|
||||||
<Segmented
|
<Segmented :options="optionsBasis" :size="dynamicSize" disabled />
|
||||||
:options="optionsDisabled"
|
|
||||||
:size="dynamicSize"
|
|
||||||
:disabled="true"
|
|
||||||
/>
|
|
||||||
<el-divider />
|
<el-divider />
|
||||||
<p class="mb-2">block 属性(将宽度调整为父元素宽度)</p>
|
<p class="mb-2">block 属性(将宽度调整为父元素宽度)</p>
|
||||||
<Segmented :options="optionsBlock" block :size="dynamicSize" />
|
<Segmented :options="optionsBlock" block :size="dynamicSize" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user