[Vuejs]-How can i get the formId of form element?

0👍

you don’t need to wrap methods inside onLoad, instead

<script>
   import uniList from '@/components/uni-list/uni-list.vue'
   import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
   import config from '../../config.js'
   export default {
    components: {
      uniList,
      uniListItem
    },
    data() { // don't care this
      //////////////////////
      return {
        avatar:'/static/default/user_default_512.png',
        name : '',
        user_id : '',
        // user:{},
        extraIcon1: {
          color: '#008000',
          size: '22',
          type: 'list'
        },
        comment:false,
        pending:{},
        userRole: '',
        roles: {},
        title_userlist: this.$i18nMsg('User list'),
        title_stabyuser: this.$i18nMsg('Statistics by user'),
        title_stabyeq: this.$i18nMsg('Statistics by eq'),
        title_about: this.$i18nMsg('About'),
        is_id_Guest:true,
        template_id: '',
        /////////////////////////////////
      }
    },
      methods: {
        submit: function(){
          console.log(this);
          ///////////////////////////////////////
          console.log(this.$els.elForm);    // 
          console.log(this.$refs.myForm);   // 
           /////////////////////////////////////
        }
      }
  }
</script>

Leave a comment