From ad459f6dd3b8dacd09d30fb559cb1b4553da5f5f Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 15 Feb 2018 01:41:31 +0900 Subject: [PATCH] wip --- src/web/app/common/define-widget.ts | 12 +- .../views/components/widgets/profile.vue | 124 +++++++++++++++++- .../desktop/-tags/home-widgets/profile.tag | 116 ---------------- 3 files changed, 129 insertions(+), 123 deletions(-) delete mode 100644 src/web/app/desktop/-tags/home-widgets/profile.tag diff --git a/src/web/app/common/define-widget.ts b/src/web/app/common/define-widget.ts index 9aed5a8902..5102ee1abf 100644 --- a/src/web/app/common/define-widget.ts +++ b/src/web/app/common/define-widget.ts @@ -1,8 +1,8 @@ import Vue from 'vue'; -export default function(data: { +export default function(data: { name: string; - props: any; + props: T; }) { return Vue.extend({ props: { @@ -10,7 +10,7 @@ export default function(data: { type: String, required: true }, - place: { + wplace: { type: String, required: true }, @@ -42,8 +42,10 @@ export default function(data: { }, created() { if (this.props) { - Object.keys(this.wprops).forEach(prop => { - this.props[prop] = this.props.data.hasOwnProperty(prop) ? this.props.data[prop] : this.props[prop]; + Object.keys(this.props).forEach(prop => { + if (this.wprops.hasOwnProperty(prop)) { + this.props[prop] = this.wprops[prop]; + } }); } } diff --git a/src/web/app/common/views/components/widgets/profile.vue b/src/web/app/common/views/components/widgets/profile.vue index 4a22d2391b..1fb756333f 100644 --- a/src/web/app/common/views/components/widgets/profile.vue +++ b/src/web/app/common/views/components/widgets/profile.vue @@ -1,5 +1,125 @@ + + + + diff --git a/src/web/app/desktop/-tags/home-widgets/profile.tag b/src/web/app/desktop/-tags/home-widgets/profile.tag deleted file mode 100644 index 02a1f0d5a3..0000000000 --- a/src/web/app/desktop/-tags/home-widgets/profile.tag +++ /dev/null @@ -1,116 +0,0 @@ - - - avatar - { I.name } -

@{ I.username }

- - -