Giter VIP home page Giter VIP logo

Comments (4)

posva avatar posva commented on May 28, 2024

IMO you should create the checkboxes yourself, remove the mdl-data-table--selectable and bind them like usual with v-model. I do plan in supporting mdl-data-table but there may be some issues until Vue 2 because of the native tr, th and td elements

from vue-mdc.

keepwn avatar keepwn commented on May 28, 2024

I tried to create the checkboxes myself, but i seem to have a little problem.
When mutil-select input checkbox, checkboxes will be a array like [tr0,tr1], but mdl-checkbox behavior different than expected.

<div class="container">
    <table id="banding-table" class="mdl-data-table mdl-js-data-table mdl-shadow--2dp">
    <thead>
        <th>
        <mdl-checkbox v-mdl-ripple-effect :checked.sync='checked'></mdl-checkbox>
        </th>
        <th>Name</th>
    </thead>
    <tbody>
        <tr v-for="service in services" id="tr{{ $index }}">
        <td>
            <mdl-checkbox v-mdl-ripple-effect :vaule="$index" :checked.sync='checkboxes'></mdl-checkbox>
            <input type="checkbox" value="tr{{ $index }}" v-model="checkboxes">
        </td>
        <td>{{ service.name }}</td>
        </tr>
    </tbody>
    </table>
    <br>
    <span>Checked names: {{ checkboxes | json }}</span>
</div>



export default {
    data () {
        return {
            checked: false,
            checkboxes: []
        }
    }
}

Am i ignore something?

from vue-mdc.

keepwn avatar keepwn commented on May 28, 2024

e....I made a stupid mistake(vaule => value).:flushed:
It works fine now, thx.

from vue-mdc.

posva avatar posva commented on May 28, 2024

no worries 😄
Remember you can use a computed value with a setter for the header checkbox

from vue-mdc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.