Guest User

Untitled

a guest
May 27th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. <template>
  2. <form @submit.prevent="submit" class="article-form-wrapper">
  3. <my-article-title :update-title-prop="article.title" :title-prop.sync="article.title"></my-article-title>
  4. </form>
  5. </template>
  6.  
  7. <script>
  8. import MyArticleTitle from '@/components/Article/ArticleTitle'
  9.  
  10. export default {
  11. props: ['articleProp'],
  12. components: {
  13. MyArticleTitle
  14. },
  15. data () {
  16. return {
  17. article: {
  18. title: ''
  19. }
  20. }
  21. },
  22. watch: {
  23. articleProp: {
  24. deep: true,
  25. handler () {
  26. this.article.title = this.articleProp.title
  27. }
  28. }
  29. },
  30. mounted () {
  31. if (this.articleProp) {
  32. console.log('looks like props?')
  33. } if (!this.articleProp) {
  34. console.log('no props')
  35. }
  36. }
  37. }
  38. </script>
Add Comment
Please, Sign In to add comment