Commit a15f7a96 authored by rockyl's avatar rockyl

data为空的情况处理

parent 4121ea7b
......@@ -32,8 +32,8 @@ export const projectStore = {
state.name = name;
state.creator = creator;
if (data) {
const localData = state.data;
if (data) {
const { views, assets, dataMapping } = JSON.parse(data);
if (!localData.views || localData.views.length === 0) {
Vue.set(localData, 'views', views || []);
......@@ -44,6 +44,16 @@ export const projectStore = {
if (!localData.dataMapping || localData.dataMapping.length === 0) {
Vue.set(localData, 'dataMapping', dataMapping || []);
}
}else{
if (!localData.views) {
Vue.set(localData, 'views', []);
}
if (!localData.assets) {
Vue.set(localData, 'assets', []);
}
if (!localData.dataMapping) {
Vue.set(localData, 'dataMapping', []);
}
}
// compoleteComponentData(state.data.views);
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment