ユニアプリ長押しイベント

<view class = " list " @ longpress = " logoTime " > 
</ view> 

メソッド:{ 
console.log(" 啊哈哈哈" ); 
}

 

例:チェックボックスをここで非表示にして、長押しするとチェックボックスが表示されます。

まず、チェックボックスコンポーネントでv-ifループを使用します。

<view class = " file-item-ckb "   v- if = " Doubleselection " > 
         
 </ view> 



 props:{ 
          Doubleselection:{ 
              type:Boolean、
              defaultfalse 
          } 
    }、

メインインターフェースの2番目のリファレンス

<view class = " list " @ longpress = " logoTime " > 
<FileItem:key = " index ":Doubleselection = " Doubleselection " /> 
</ view> 


data(){ 

return { 
Doubleselection:false 

}} 


メソッド:{ 
 logoTime (
                // console.log( "ahahahh"); 
        this .Doubleselection = true ; 
       }、

}

 

おすすめ

転載: www.cnblogs.com/lovebear123/p/12689476.html