in official vue demo “Framework7-Vue-Webpack-Template”, I add swipeout test code in home.vue as follow:
<template>
<f7-page @page:init="onPageInit">
<f7-navbar>
<f7-nav-left>
<f7-link icon-if-ios="f7:menu" icon-if-md="material:menu" panel-open="left">返回</f7-link>
</f7-nav-left>
<f7-nav-title>My App</f7-nav-title>
<f7-nav-right>
<f7-link icon-if-ios="f7:menu" icon-if-md="material:menu" panel-open="right">提交</f7-link>
</f7-nav-right>
</f7-navbar>
<f7-toolbar>
<f7-link>Left Link</f7-link>
<f7-link>Right Link</f7-link>
</f7-toolbar>
<f7-block strong></f7-block>
<f7-list>
<f7-list-item
swipeout
title="Swipe left on me please"
>
<f7-swipeout-actions right>
<f7-swipeout-button @click="more">More</f7-swipeout-button>
<f7-swipeout-button delete>Delete</f7-swipeout-button>
</f7-swipeout-actions>
</f7-list-item>
</f7-list>
<f7-block-title>Navigation</f7-block-title>
<f7-list>
<f7-list-item link="/about/" title="About"></f7-list-item>
<f7-list-item link="/form/" title="Form"></f7-list-item>
</f7-list>
<f7-block-title>Modals</f7-block-title>
<f7-block strong>
<f7-row>
<f7-col width="50">
<f7-button fill raised popup-open="#popup">Popup</f7-button>
</f7-col>
<f7-col width="50">
<f7-button fill raised login-screen-open="#login-screen">Login Screen</f7-button>
</f7-col>
</f7-row>
</f7-block>
<f7-block-title>Panels</f7-block-title>
<f7-block strong>
<f7-row>
<f7-col width="50">
<f7-button fill raised panel-open="left">Left Panel</f7-button>
</f7-col>
<f7-col width="50">
<f7-button fill raised panel-open="right">Right Panel</f7-button>
</f7-col>
</f7-row>
</f7-block>
<f7-list>
<f7-list-item link="/dynamic-route/blog/45/post/125/?foo=bar#about" title="Dynamic Route"></f7-list-item>
<f7-list-item link="/load-something-that-doesnt-exist/" title="Default Route (404)"></f7-list-item>
</f7-list>
</f7-page>
</template>
<script>
export default {
methods: {
more() {
const self = this;
self.actions.open();
},
onPageInit() {
const self = this;
const app = self.$f7;
self.actions = app.actions.create({
buttons: [
[
{
text: 'Here comes some optional description or warning for actions below',
label: true,
},
{
text: 'Action 1',
},
{
text: 'Action 2',
},
],
[
{
text: 'Cancel',
bold: true,
},
],
],
});
},
}
}
</script>
The swipeout component does not work. My test step as follow:
- run “npm run dev”
- open url 127.0.0.1:8080 in chrome
- press f12 to call debug mode.
- press button named "toggle device toolbar " to call phone debug mode
- then swipe left on swipeout component. The component do not work.
After I had refreshed the url, It could work, but I don`t know why.