mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-04 00:10:25 +08:00
39 lines
642 B
Vue
39 lines
642 B
Vue
<template>
|
|
<div>
|
|
<el-input type="textarea" v-model="modelValue" />
|
|
</div>
|
|
</template>
|
|
<script lang="ts" setup>
|
|
import { reactive, watch, toRefs, onMounted } from 'vue';
|
|
|
|
const props = defineProps({
|
|
content: {
|
|
type: String,
|
|
},
|
|
});
|
|
|
|
const state = reactive({
|
|
modelValue: '',
|
|
});
|
|
|
|
const { modelValue } = toRefs(state);
|
|
|
|
watch(
|
|
() => props.content,
|
|
(val: any) => {
|
|
state.modelValue = val;
|
|
}
|
|
);
|
|
|
|
onMounted(() => {
|
|
state.modelValue = props.content as any;
|
|
});
|
|
|
|
const getContent = () => {
|
|
return state.modelValue;
|
|
};
|
|
|
|
defineExpose({ getContent });
|
|
</script>
|
|
<style lang="scss"></style>
|