[solved] How to set accordion`s prop?


#1

I want to set accordion`s prop. I test the follow code, but never works.

<f7-list accordion >
  <f7-list-item title="流程历史" v-bind:link="'/oa/activities/' + item.processInstanceId"></f7-list-item>
  <f7-list-item title="附件数据" v-bind:link="'/oa/attachments/' + item.id"></f7-list-item>
  <!--<f7-list-item title="业务审批" link="#" @click="popupOpened = true"></f7-list-item>-->
  <f7-list-item accordion-item  id="m2"  title="业务审批">
    <f7-accordion-content>
      <f7-block>
      </f7-block>
    </f7-accordion-content>
  </f7-list-item>
</f7-list>


let $$ = that.Dom7;
$$("#m2").prop('opened', true) ;

let myaccordion = f7.get("#m2");
myaccordion.opened = true;

Could somebody help me?


#2

Well, this is something new. How is that you are trying to set Vue properties with DOM methods? In vue it should be different:

<template>
  ...
    <something :opened="opened"></something>
    <f7-link @click="makeOpened">Make it opened</f7-link>
  ...
</template>
<script>
export default {
  data() {
    return {
      opened: false
    }
  },
  methods: {
    makeOpened() {
      this.opened = true;
    }
  },
}
</script>


#3

thank u. According ur hint, I use the following code, and it was works well.

<f7-list-item accordion-item id="m2" :accordion-item-opened="true" title="业务审批"> ....