File tree 2 files changed +14
-2
lines changed
2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ const appStore = useAppStore()
68
68
const props = defineProps({
69
69
modelValue: {type: String},
70
70
height: {type: Number, default: 400},
71
- id: {type: String, default: () => 'tinymce' + new Date().getTime().toString ()},
71
+ id: {type: String, default: () => tool.uuid ()},
72
72
plugins: {
73
73
type: [String, Array],
74
74
default:
@@ -132,7 +132,7 @@ const getStoreMode = (mode) => {
132
132
return uploadConfig.storageMode[mode.toString()]
133
133
}
134
134
135
- const editorKey = ref(new Date().getTime())
135
+ const editorKey = props.id
136
136
137
137
watch(
138
138
() => list.value,
Original file line number Diff line number Diff line change @@ -359,4 +359,16 @@ tool.arrSum = (arr) => {
359
359
return sum
360
360
}
361
361
362
+ tool . uuid = ( ) => {
363
+ const randomBytes = CryptoJS . lib . WordArray . random ( 16 ) ;
364
+ const randomHex = randomBytes . toString ( CryptoJS . enc . Hex ) ;
365
+ return [
366
+ randomHex . substr ( 0 , 8 ) ,
367
+ randomHex . substr ( 8 , 4 ) ,
368
+ randomHex . substr ( 12 , 4 ) ,
369
+ randomHex . substr ( 16 , 4 ) ,
370
+ randomHex . substr ( 20 , 12 )
371
+ ] . join ( '-' ) ;
372
+ }
373
+
362
374
export default tool
You can’t perform that action at this time.
0 commit comments