41 lines
1.0 KiB
JavaScript
41 lines
1.0 KiB
JavaScript
export default OakComponent({
|
|
isList: false,
|
|
formData: function ({ features }) {
|
|
return {};
|
|
},
|
|
data: {
|
|
content: '',
|
|
title: '',
|
|
},
|
|
lifetimes: {
|
|
async attached() {
|
|
const data = await this.load('article_html') || '{}';
|
|
const article = typeof data === 'string' ? JSON.parse(data) : data;
|
|
if (article?.title) {
|
|
window.document.title = article.title;
|
|
}
|
|
this.setState({
|
|
content: article?.content,
|
|
title: article?.title,
|
|
});
|
|
},
|
|
detached() {
|
|
this.save('article_html', '{}');
|
|
},
|
|
},
|
|
properties: {
|
|
tocClosed: false,
|
|
tocFixed: true,
|
|
tocPosition: 'none',
|
|
highlightBgColor: 'none',
|
|
headerTop: 0,
|
|
className: '',
|
|
scrollId: '',
|
|
tocWidth: undefined,
|
|
tocHeight: undefined,
|
|
showtitle: false,
|
|
activeColor: undefined,
|
|
},
|
|
methods: {},
|
|
});
|