test
This commit is contained in:
parent
7f0964c627
commit
7925080ea2
|
|
@ -113,11 +113,6 @@ const disabled = computed(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
setup() {
|
|
||||||
console.log(111)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
/**
|
/**
|
||||||
* 新增
|
* 新增
|
||||||
*/
|
*/
|
||||||
|
|
@ -134,6 +129,11 @@ function edit(record) {
|
||||||
resetFields();
|
resetFields();
|
||||||
//赋值
|
//赋值
|
||||||
Object.assign(formData, record);
|
Object.assign(formData, record);
|
||||||
|
if (formData.id) {
|
||||||
|
getContent()
|
||||||
|
}else{
|
||||||
|
articleContent.value = ''
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -161,6 +161,7 @@ async function submitForm() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
model.content = articleContent.value
|
||||||
await saveOrUpdate(model, isUpdate.value)
|
await saveOrUpdate(model, isUpdate.value)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
|
@ -175,25 +176,22 @@ async function submitForm() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getContent()
|
onMounted(() => {
|
||||||
|
console.log(`the component is now mounted.`)
|
||||||
|
})
|
||||||
function getContent() {
|
function getContent() {
|
||||||
let params = {id: formData.id}
|
let params = {id: formData.id}
|
||||||
defHttp.get<Object>({url: '/yx/yxArticle/queryById', params}).then((res) => {
|
defHttp.get({url: '/yx/yxArticle/queryById', params})
|
||||||
|
.then((res) => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
if (Array.isArray(res)) {
|
articleContent.value = res.content
|
||||||
resolve(res);
|
|
||||||
} else {
|
|
||||||
resolve(res['menu']);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
console.log('11')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const articleContent = ref('hello world!');
|
const articleContent = ref('');
|
||||||
|
|
||||||
function handleTinymceChange(value: string) {
|
function handleTinymceChange(value: string) {
|
||||||
formData.ArticleContent = value
|
formData.articleContent = value
|
||||||
console.log(value);
|
console.log(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue