12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <template>
- <div class="username-container p-h-12">
- <van-field v-model="nickname" clearable label="昵称" placeholder="请输入" input-align="right" />
- <div class="btn" @click="handleSaveOperate">submit</div>
- </div>
- </template>
- <script>
- import updateUserInfoMixin from './updateUserInfo.mixin'
- export default {
- name: 'Nickname',
- mixins: [
- updateUserInfoMixin
- ],
- created() {
- this.nickname = this.$store.state.user.nickname
- },
- data() {
- return {
- nickname: ''
- }
- },
- methods: {
- handleSaveOperate() {
- const nickname = this.nickname
- if (!nickname) return this.$toast.fail('昵称尚未填写')
- const params = {
- type: 2,
- nickname: this.nickname
- }
- this.put_userinfo(params, true)
- },
- }
- }
- </script>
- <style lang="less">
- .username {
- &-container {
- margin-top: 10px;
- background-color: #fff;
- }
- }
- </style>
|