sh-view 2.4.4 → 2.4.6
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.
package/package.json
CHANGED
|
@@ -145,7 +145,7 @@ export default defineComponent({
|
|
|
145
145
|
|
|
146
146
|
const codeRender = async () => {
|
|
147
147
|
let docValue = getTransformValue(props.modelValue)
|
|
148
|
-
let codeState =
|
|
148
|
+
let codeState = EditorState.create({
|
|
149
149
|
doc: docValue,
|
|
150
150
|
extensions: codeExtensions.value
|
|
151
151
|
})
|
|
@@ -53,7 +53,7 @@ import { defineComponent, watch, ref } from 'vue'
|
|
|
53
53
|
export default defineComponent({
|
|
54
54
|
name: 'ShModal',
|
|
55
55
|
props: {
|
|
56
|
-
|
|
56
|
+
modelValue: {
|
|
57
57
|
type: Boolean
|
|
58
58
|
},
|
|
59
59
|
id: {
|
|
@@ -147,11 +147,11 @@ export default defineComponent({
|
|
|
147
147
|
default: '取消'
|
|
148
148
|
}
|
|
149
149
|
},
|
|
150
|
-
emits: ['show', 'hide', 'zoom', 'confirm', 'close'
|
|
150
|
+
emits: ['update:modelValue', 'show', 'hide', 'zoom', 'confirm', 'close'],
|
|
151
151
|
setup(props, context) {
|
|
152
152
|
const { emit, slots } = context
|
|
153
153
|
const modalRef = ref()
|
|
154
|
-
const modalVisible = ref(props.
|
|
154
|
+
const modalVisible = ref(props.modelValue)
|
|
155
155
|
|
|
156
156
|
// 弹窗显示回调
|
|
157
157
|
const onModalShow = () => {
|
|
@@ -172,11 +172,11 @@ export default defineComponent({
|
|
|
172
172
|
// 取消操作
|
|
173
173
|
const onModalClose = () => {
|
|
174
174
|
emit('close')
|
|
175
|
-
emit('update:
|
|
175
|
+
emit('update:modelValue', false)
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
watch(
|
|
179
|
-
() => props.
|
|
179
|
+
() => props.modelValue,
|
|
180
180
|
value => {
|
|
181
181
|
modalVisible.value = value
|
|
182
182
|
}
|