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,
|
||||
default: false
|
||||
},
|
||||
/** 控件尺寸 */
|
||||
/** 控件尺寸 */
|
||||
size: {
|
||||
type: String as PropType<"small" | "default" | "large">
|
||||
},
|
||||
/** 是否global禁用,默认false */
|
||||
/** 是否全局禁用,默认 `false` */
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
@ -62,8 +62,7 @@ export default defineComponent({
|
||||
: ref(0);
|
||||
|
||||
function handleChange({ option, index }, event: Event) {
|
||||
if (props.disabled) return;
|
||||
if (option.disabled) return;
|
||||
if (props.disabled || option.disabled) return;
|
||||
event.preventDefault();
|
||||
isNumber(props.modelValue)
|
||||
? emit("update:modelValue", index)
|
||||
@ -138,9 +137,10 @@ export default defineComponent({
|
||||
style={{
|
||||
background:
|
||||
curMouseActive.value === index ? segmentedItembg.value : "",
|
||||
color:
|
||||
!option.disabled &&
|
||||
(curIndex.value === index || curMouseActive.value === index)
|
||||
color: props.disabled
|
||||
? null
|
||||
: !option.disabled &&
|
||||
(curIndex.value === index || curMouseActive.value === index)
|
||||
? isDark.value
|
||||
? "rgba(255, 255, 255, 0.85)"
|
||||
: "rgba(0,0,0,.88)"
|
||||
|
@ -241,11 +241,7 @@ watch(size, val => (dynamicSize.value = size.value));
|
||||
<Segmented :options="optionsDisabled" :size="dynamicSize" />
|
||||
<el-divider />
|
||||
<p class="mb-2">全局禁用</p>
|
||||
<Segmented
|
||||
:options="optionsDisabled"
|
||||
:size="dynamicSize"
|
||||
:disabled="true"
|
||||
/>
|
||||
<Segmented :options="optionsBasis" :size="dynamicSize" disabled />
|
||||
<el-divider />
|
||||
<p class="mb-2">block 属性(将宽度调整为父元素宽度)</p>
|
||||
<Segmented :options="optionsBlock" block :size="dynamicSize" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user