vue2-client 1.22.30 → 1.22.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="x-radio-container" :class="wrapperClassObject()">
2
+ <div class="x-radio-container" v-show="!isHidden" :class="wrapperClassObject()">
3
3
  <!-- 按钮模式 -->
4
4
  <a-radio-group
5
5
  v-if="config.buttonMode"
@@ -102,6 +102,11 @@
102
102
  type: Boolean,
103
103
  default: false
104
104
  },
105
+ // 组件默认是否隐藏
106
+ defaultHidden: {
107
+ type: Boolean,
108
+ default: false
109
+ },
105
110
  // eslint-disable-next-line vue/require-default-prop
106
111
  value: [String, Number, Object]
107
112
  },
@@ -117,10 +122,17 @@
117
122
  showBorder: false,
118
123
  highlightBorder: false,
119
124
  buttonMode: false
120
- }
125
+ },
126
+ // ★ 新增:控制组件显隐
127
+ isHidden: false
121
128
  }
122
129
  },
123
130
  created () {
131
+ // ★ 根据 defaultHidden 初始化显隐状态
132
+ if (this.defaultHidden) {
133
+ this.isHidden = true
134
+ }
135
+
124
136
  if (this.options != null && Array.isArray(this.options)) {
125
137
  this.useOptionsProp()
126
138
  } else {
@@ -149,6 +161,19 @@
149
161
  },
150
162
  emits: ['change', 'init'],
151
163
  methods: {
164
+ // ★ 新增:隐藏组件(与 XTitle 方法名一致)
165
+ hide () {
166
+ this.isHidden = true
167
+ },
168
+ // ★ 新增:显示组件
169
+ show () {
170
+ this.isHidden = false
171
+ },
172
+ // ★ 新增:切换显隐状态
173
+ toggle () {
174
+ this.isHidden = !this.isHidden
175
+ },
176
+
152
177
  /** 使用 options 参数作为数据源(不请求配置) */
153
178
  useOptionsProp () {
154
179
  this.data = this.options || []