Skip to content
This repository has been archived by the owner on Apr 1, 2022. It is now read-only.

Add tdComp: blank #9

Closed
agungid opened this issue Aug 21, 2017 · 27 comments
Closed

Add tdComp: blank #9

agungid opened this issue Aug 21, 2017 · 27 comments

Comments

@agungid
Copy link

agungid commented Aug 21, 2017

Hi. I'm having trouble composing tdComp. The element I created is not showing. Is there something missing?
Code https://pastebin.com/WTu9ege4

@kenberkeley
Copy link
Collaborator

Pardon me for replying so late.
Have you solved the problem?

@kenberkeley
Copy link
Collaborator

Line65:</dvi>

@agungid
Copy link
Author

agungid commented Aug 21, 2017

Not yet. I fixed it but still blank.

<template>
  <div>
    <button class="btn btn-default" title="Edit">
      <i class="fa fa-pencil"></i>
    </button>
  </div>
</template>

@kenberkeley
Copy link
Collaborator

Any snapshot? Any console error message?

@agungid
Copy link
Author

agungid commented Aug 21, 2017

In the console there is no error
duaaa
satu

@kenberkeley
Copy link
Collaborator

It seems that Opt is unavailable.
Try: in Vue devtools, select Datatable in the component tree. Then execute $vm.comp in the console

@kenberkeley
Copy link
Collaborator

The console should output Object { Opt: XXX } if everything's alright

@agungid
Copy link
Author

agungid commented Aug 21, 2017

empat
tiga

@kenberkeley
Copy link
Collaborator

Very strange...

@kenberkeley
Copy link
Collaborator

It couldn't be possible...

@agungid
Copy link
Author

agungid commented Aug 21, 2017

@kenberkeley Is there any other solution to this problem?

@cosmic-fibre
Copy link

@kenberkeley can you elaborate more please?

@kenberkeley
Copy link
Collaborator

Register Opt component globally please

@kenberkeley
Copy link
Collaborator

Is that OK?

@agungid
Copy link
Author

agungid commented Aug 21, 2017

Still not able. The code is like this
https://pastebin.com/k08MkyxE

@kenberkeley
Copy link
Collaborator

You should Vue.component('Opt', components.Opt)

@agungid
Copy link
Author

agungid commented Aug 21, 2017

Yeah this works.
But if the register to global what will not be a problem?

@kenberkeley
Copy link
Collaborator

kenberkeley commented Aug 21, 2017

Oh I see.
https://pastebin.com/k08MkyxE Line11 and Line47.
components conflicts, so the latter overrides the former

@kenberkeley
Copy link
Collaborator

At the beginning, the code in https://pastebin.com/WTu9ege4 did not appear this problem.
That's why I felt so strange.

@kenberkeley
Copy link
Collaborator

It would be better to present an integrity example next time.

@agungid
Copy link
Author

agungid commented Aug 21, 2017

I have changed like this. But it did not work

import cmp from './cmp/'
export default {
  cmp,
 .......
}

@agungid
Copy link
Author

agungid commented Aug 21, 2017

Successful if registered in global

@kenberkeley
Copy link
Collaborator

Why not trying:

components: {
  addPartisipant,
  editPartisipant,
  ...cmp
}

@kenberkeley
Copy link
Collaborator

Checkout Vue.js official docs: https://vuejs.org/v2/guide/components.html#Local-Registration

@agungid
Copy link
Author

agungid commented Aug 21, 2017

Thanks. This works well

@kenberkeley
Copy link
Collaborator

It is suggested using ESLint to avoid these mistakes.

@agungid
Copy link
Author

agungid commented Aug 21, 2017

Ok, thank you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants