Skip to content

Latest commit

 

History

History
71 lines (52 loc) · 2.92 KB

FAQ.md

File metadata and controls

71 lines (52 loc) · 2.92 KB

FAQ

Why are my event listeners not working?

In Vue 2.0, adding native event handlers in custom components requires a .native modifier:

<my-component @click.native="handleClick">Click Me</my-component>

For the sake of usability, we processed Button so it can listen to click events:

<tm-button @click="handleButtonClick">Click Me</tm-button>

For other components, the .native modifier is still mandatory.

How do I add buttons in each row of Table to operate data of that row?

Just use Scoped slot:

<tm-table-column label="Operations">
  <template slot-scope="props">
    <tm-button @click.native="showDetail(props.row)">Details</tm-button>
  </template>
</tm-table-column>

The parameter row is the data object of corresponding row.

How do `render-content` of Tree and `render-header` of Table work?

Please refer to Render Function in Vue's documentation. In addition, if you are writing render functions with JSX, babel-plugin-transform-vue-jsx is required. See here for its configurations.

Can I use `.sync` modifier on every attribute?

No, only a few attributes supports the .sync modifier, and we have explicitly marked them on the documentation's API table. For more information about .sync, please refer to Vue documentation.

When do you update documentations of TM-Ui?

We update documentations only when a new version of TM-Ui is published so that it reflects all the changes introduced in that version. Updated changed can be found in the changelog

I imported TM-Ui in my project, but why does it report CSS error/font file error/components have no style?

Please refer to our starter kit and correctly configure file-loader, css-loader and style-loader in webpack config file. Besides, we also provide templated based on cooking and laravel.

I cloned TM-Ui's repo, but failed to run it. How do I solve it?

First, please make sure to clone the latest code in master branch and cloned files are intact. Then, note that the version of Nodejs should be 4.0+ and npm 3.0+. Finally, activate development:

npm run dev

or build it:

npm run dist