代码之家  ›  专栏  ›  技术社区  ›  squeekyDave

在iOS Framework7 vue应用程序中,手风琴动画的速度非常慢

  •  0
  • squeekyDave  · 技术社区  · 7 年前

    我正在用Framework7Vue构建android和iOS应用程序。

    用户将被赋予选择,以查看弹出窗口,这个弹出窗口将有一个手风琴内。 我尝试了一些东西,在谷歌上搜索了一下,但没有成功。

    下面您将看到我的app.js实现和一个包含弹出窗口的代码片段。 我很高兴听到你的建议,谢谢。

    const questions =  {
        questionOne:'Does the subject have a high CCA?',
        options: {
            yes:'Yes',
            no:'No'
        },
        selected:{
          yes: {
            questionTwo: 'High PTH and yes to high CCA',
            options: [
              'PTH > 80pmol/L',
              'PTH < 80pmol but > 50pmol/L and increasing',
              'PTH < 50 but higher than base line'
            ]
          },
          no: {
            questionTwo: 'PTH > 80pmol/L',
            options: [
              'Refer for surgical parathyroidectomy',
              'Start Cinacalcet if parathyroidectomy is'
            ]
          }
        }
    }
    //  this.$$ - this.Dom7;
    
    Vue.use(Framework7Vue);
    
    // Init Page Components
    Vue.component('page-education', {
      template: '#page-education'
    });
    Vue.component('page-mbddef', {
      template: '#page-mbddef'
    });
    Vue.component('page-ckdmbdeffects', {
      template: '#page-ckdmbdeffects'
    });
    Vue.component('page-algorithms', {
      template: '#page-algorithms'
    });
    Vue.component('page-highpth', {
      template: '#page-highpth'
    });
    Vue.component('page-dietary', {
      template: '#page-dietary'
    });
    
    
    
    // Handle device ready event
    // Note: You may want to check out the vue-cordova package on npm for cordova specific handling with vue - https://www.npmjs.com/package/vue-cordova
    document.addEventListener('deviceready', () => {
      console.log("DEVICE IS READY!");    
    }, false)
    
    // Init App
    
    // var $$ = dom7;
    // console.log($$);
    // var $$ = this.Dom7;
    // console.log($$);
    const mainApp = new Vue({
      el: '#app',
      data: {
        popupOpened: false,
        navBarShowing: true,
        showingGreenCard: false,
        currQuestion: questions.questionOne,
        currOptCount: 2,
        currOptions: questions.options,
        showing: false,
        isShowing: true,
        icon:       "<i class='far fa-file-alt'></i>",
        homeIcon:   "<i id='sidemenu-icon' class='fas fa-home'></i>",
        pencilIcon: "<i id='sidemenu-icon' class='fas fa-pencil-alt'></i>",
        healthIcon: "<i id='sidemenu-icon' class='fas fa-plus'></i>",
        algIcon:    "<i id='sidemenu-icon' class='fas fa-align-justify'></i>",
        dietIcon:   "<i id='sidemenu-icon' class='fas fa-utensils'></i>",
        clipIcon:   "<i id='sidemenu-icon' class='far fa-clipboard'></i>",
        linkIcon:   "<i id='sidemenu-icon' class='fas fa-link'></i>"
      },
      progress: {
        value: 10
      },
      on: {
        pageInit: function(){
          console.log('page');
        }
      },
      methods: {
        setInlineProgress: function(value) {
          this.value = value;
          const self = this;
          const app = self.$f7;
          app.setProgressbar('#demo-inline-progressbar', this.value);
        },
        toHomeScreen: function() {
          this.$f7.getCurrentView().router.back({ pageName: 'home-page', force: true, refreshPrevious: true});
          this.$f7.closePanel();
        },
        shouldShow: function() {
          this.showing = true;
        },
        generateQuestion: function(answer){
           this.currQuestion = questions.selected.yes.questionTwo;
           this.optionsOne = 'Yes';
           this.optionTwo = 'No';
           this.shouldShow();
        },
        showPopUp: function(e) {
         this.showingGreenCard = true;
        },
        closePopUp: function(){
          this.showingGreenCard = false;
        },
      },
      on:{
    
      },
      // Init Framework7 by passing parameters here
      framework7: {
        root: '#app',
        /* Uncomment to enable Material theme: */
        material: true,
        routes: [
          {
            path:'/',
            name: 'home'
          }
          ,
          {
            path: '/education/',
            component: 'page-education'
          },
          {
            path: '/ckdmbddef/',
            component: 'page-mbddef'
          },
          {
            path: '/ckdmbdeffects/',
            component: 'page-ckdmbdeffects'
          },
          {
            path: '/algorithms/',
            component: 'page-algorithms',
          },
          {
            path: '/highpth/',
            component: 'page-highpth'
          },
          {
            path: '/dietary/',
            component: 'page-dietary'
          },
          {
            path: '/form/',
            component: 'page-form'
          },
          {
            path: '/dynamic-route/blog/:blogId/post/:postId/',
            component: 'page-dynamic-routing'
          }
        ],
      }
    });
    

    以下是弹出窗口片段:

     <div class="popup-card-four" v-if="mainApp.showingGreenCard">
                    <p class="popup-text">Suitable low phosphate foods</p>
                    <i id="close-icon" @click="mainApp.closePopUp()" class="far fa-times-circle"></i>
                    <f7-list class="main-acc-list" accordion-list>
                        <f7-list-item id="acc-one-title" accordion-item title="Lower phosphate diary">
                          <f7-accordion-content class="table-wrapper">
                            <f7-block >
                                <table class="main-table">
                                    <tr class="table-underline">
                                      <td class="popup-inner">Milk</td>
                                      <td class="popup-inner">Rice or milk</td>
                                    </tr>
                                    <tr>
                                      <td class="popup-inner">Cheese</td>
                                      <td class="popup-inner">Cottage Cheese</td>
                                    </tr>
                                    <tr>
                                      <td></td>
                                      <td class="popup-inner">Cream cheese</td>
                                    </tr>
                                    <tr>
                                      <td></td>
                                      <td class="popup-inner">Quark</td>
                                    </tr>
                                    <tr class="table-underline">
                                      <td></td>
                                      <td class="popup-inner">Ricotta</td>
                                    </tr>
                                    <tr>
                                      <td class="popup-inner">Cream</td>
                                      <td class="popup-inner">Single, double, whipping,</td>
                                    </tr>
                                    <tr>
                                      <td></td>
                                      <td class="popup-inner">pouring, clotted,</td>
                                    </tr>
                                    <tr>
                                      <td></td>
                                      <td class="popup-inner">Marscapone</td>
                                    </tr>
                                  </table>
                            </f7-block>
                          </f7-accordion-content>
                        </f7-list-item>
                        <f7-list-item id="acc-one-title" accordion-item title="Lower phosphate diary">
                          <f7-accordion-content>
                            <f7-list>
                              <f7-list-item title="Item 1"></f7-list-item>
                              <f7-list-item title="Item 2"></f7-list-item>
                              <f7-list-item title="Item 3"></f7-list-item>
                              <f7-list-item title="Item 4"></f7-list-item>
                            </f7-list>
                          </f7-accordion-content>
                        </f7-list-item>
                        <f7-list-item id="acc-one-title" accordion-item title="Lower phosphate diary">
                          <f7-accordion-content>
                            <f7-block>
                              <p>
                                Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean elementum id neque nec commodo. Sed vel justo at turpis laoreet pellentesque quis sed lorem. Integer semper arcu nibh, non mollis arcu tempor vel. Sed pharetra tortor vitae est rhoncus, vel congue dui sollicitudin. Donec eu arcu dignissim felis viverra blandit suscipit eget ipsum.
                              </p>
                            </f7-block>
                          </f7-accordion-content>
                        </f7-list-item>
                      </f7-list>
                  </div>
    
    1 回复  |  直到 7 年前
        1
  •  0
  •   squeekyDave    7 年前

    通过删除accordion的framework7 vue组件并用standart framework7 html accordion组件替换它,解决了此问题。

    希望这对别人有帮助。 干杯。

    推荐文章