Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(VTreeview): don't emit events on mount #7546

Merged
merged 2 commits into from
Jun 18, 2019
Merged

fix(VTreeview): don't emit events on mount #7546

merged 2 commits into from
Jun 18, 2019

Conversation

nekosaur
Copy link
Member

Description

fix treeview emitting events on mount

Motivation and Context

solves #7296

How Has This Been Tested?

playground

Markup:

<template>
  <v-container>
    <v-treeview
         :items="items"
         :active="selected"
         v-model="selected"
         selectable
         @input="logInput($event)"
        >
        </v-treeview>
  </v-container>
</template>

<script>
  export default {
    data: () => ({
      selected: [6],
      items: [
          {
            id: 1,
            name: 'Applications :',
            children: [
              { id: 2, name: 'Calendar : app' },
              { id: 3, name: 'Chrome : app' },
              { id: 4, name: 'Webstorm : app' }
            ]
          },
          {
            id: 5,
            name: 'Documents :',
            children: [
              {
                id: 6,
                name: 'vuetify :',
                children: [
                  {
                    id: 7,
                    name: 'src :',
                    children: [
                      { id: 8, name: 'index : ts' },
                      { id: 9, name: 'bootstrap : ts' }
                    ]
                  }
                ]
              },
              {
                id: 10,
                name: 'material2 :',
                children: [
                  {
                    id: 11,
                    name: 'src :',
                    children: [
                      { id: 12, name: 'v-btn : ts' },
                      { id: 13, name: 'v-card : ts' },
                      { id: 14, name: 'v-window : ts' }
                    ]
                  }
                ]
              }
            ]
          },
          {
            id: 15,
            name: 'Downloads :',
            children: [
              { id: 16, name: 'October : pdf' },
              { id: 17, name: 'November : pdf' },
              { id: 18, name: 'Tutorial : html' }
            ]
          },
          {
            id: 19,
            name: 'Videos :',
            children: [
              {
                id: 20,
                name: 'Tutorials :',
                children: [
                  { id: 21, name: 'Basic layouts : mp4' },
                  { id: 22, name: 'Advanced techniques : mp4' },
                  { id: 23, name: 'All about app : dir' }
                ]
              },
              { id: 24, name: 'Intro : mov' },
              { id: 25, name: 'Conference introduction : avi' }
            ]

          }
        ]
    }),
    beforeMount:function(){
      console.log('Component beforeMount');
    },
    mounted:function(){
      console.log('Component Mounted');
    },
    methods:{
      logInput(e){
        console.log('Input Event Fired');
      }
    }
  }
</script>

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Improvement/refactoring (non-breaking change that doesn't add any feature but make things better)

Checklist:

  • The PR title is no longer than 64 characters.
  • The PR is submitted to the correct branch (master for bug fixes and documentation updates, dev for new features and breaking changes).
  • My code follows the code style of this project.
  • I've added relevant changes to the documentation (applies to new features and breaking changes in core library)

@johnleider johnleider added the T: enhancement Functionality that enhances existing features label Jun 17, 2019
@johnleider johnleider added this to the v2.0.0 milestone Jun 17, 2019
@dsseng dsseng changed the title fix(VTreeview): emits events on mount fix(VTreeview): don't emit events on mount Jun 18, 2019
@dsseng dsseng merged commit 023e596 into next Jun 18, 2019
@dsseng dsseng deleted the fix/v-treeview-emit branch June 18, 2019 14:16
@lock lock bot locked as resolved and limited conversation to collaborators Jul 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T: enhancement Functionality that enhances existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants