...
|
...
|
@@ -28,6 +28,7 @@ module.exports = { |
|
|
type: String,
|
|
|
required: true
|
|
|
},
|
|
|
initData: Array, /* 初始数据, 应该只单次绑定, 然后fetch数据全靠url */
|
|
|
query: Object /* 请求参数 */
|
|
|
},
|
|
|
data: function() {
|
...
|
...
|
@@ -48,8 +49,13 @@ module.exports = { |
|
|
});
|
|
|
}
|
|
|
},
|
|
|
ready: function() {
|
|
|
this.fetch();
|
|
|
created: function() {
|
|
|
// 有初始数据,用初始数据
|
|
|
if (this.initData) {
|
|
|
self.$set('products', self.products.concat(this.initData));
|
|
|
} else if (this.url) {
|
|
|
this.fetch();
|
|
|
}
|
|
|
},
|
|
|
};
|
|
|
</script>
|
...
|
...
|
@@ -109,4 +115,23 @@ module.exports = { |
|
|
color: $red;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.drawer-slide {
|
|
|
position: fixed;
|
|
|
top: 0;
|
|
|
right: 0;
|
|
|
bottom: 0;
|
|
|
left: 0;
|
|
|
background-color: rgba(0, 0, 0, 0.6);
|
|
|
}
|
|
|
|
|
|
.drawer-main {
|
|
|
position: absolute;
|
|
|
top: 0;
|
|
|
right: 0;
|
|
|
bottom: 0;
|
|
|
min-width: 80%;
|
|
|
max-width: 100%;
|
|
|
background-color: #fff;
|
|
|
}
|
|
|
</style> |
...
|
...
|
|