做爰高潮a片〈毛片〉,尤物av天堂一区二区在线观看,一本久久A久久精品VR综合,添女人荫蒂全部过程av

最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當前位置: 首頁 - 科技 - 知識百科 - 正文

vue2.0的contextmenu右鍵彈出菜單的實例代碼

來源:懂視網 責編:小采 時間:2020-11-27 22:34:07
文檔

vue2.0的contextmenu右鍵彈出菜單的實例代碼

vue2.0的contextmenu右鍵彈出菜單的實例代碼:整理文檔,搜刮出一個vue2.0的contextmenu右鍵彈出菜單的實例代碼,稍微整理精簡一下做下分享。 1.事情對象 <!DOCTYPE html> <html> <head> <title></title> <meta charset=ut
推薦度:
導讀vue2.0的contextmenu右鍵彈出菜單的實例代碼:整理文檔,搜刮出一個vue2.0的contextmenu右鍵彈出菜單的實例代碼,稍微整理精簡一下做下分享。 1.事情對象 <!DOCTYPE html> <html> <head> <title></title> <meta charset=ut

整理文檔,搜刮出一個vue2.0的contextmenu右鍵彈出菜單的實例代碼,稍微整理精簡一下做下分享。

1.事情對象

<!DOCTYPE html>
<html>
<head>
 <title></title>
 <meta charset="utf-8">
 <script src="http://unpkg.com/vue/dist/vue.js"></script>

 <script type="text/javascript">
 window.onload = function(){
 var vm = new Vue({
 el:'#box',
 methods:{
 show:function(event){
 console.log(event); //event 這個就是事件對象了
 }
 }
 });
 }
 </script>
</head>
<body>
 <div id="box">
 <input type="button" value="按鈕" @click="show($event)"> 
 </div>
</body>
</html>

通過show($event)把事件對象傳到方法里

2.事件冒泡

<!DOCTYPE html>
<html>
<head>
 <title></title>
 <meta charset="utf-8">
 <script src="http://unpkg.com/vue/dist/vue.js"></script>

 <script type="text/javascript">
 window.onload = function(){
 var vm = new Vue({
 el:'#box',
 methods:{
 show:function(){
 alert(1);
 },
 show1:function(){
 alert(2);
 }
 }
 });
 }
 </script>
</head>
<body>
 <div id="box">
 <div @click="show1()">
 <input type="button" value="按鈕" @click="show()"> 
 </div>
 </div>
</body>
</html>

點擊按鈕的話他會,執行show ,show1方法,依次彈出1,2。

怎么來阻止

<1> 利用我們上面講過的event對象:  event.cancelBubble = true;   //這種就阻止了

<!DOCTYPE html>
<html>
<head>
 <title></title>
 <meta charset="utf-8">
 <script src="http://unpkg.com/vue/dist/vue.js"></script>

 <script type="text/javascript">
 window.onload = function(){
 var vm = new Vue({
 el:'#box',
 methods:{
 show:function(event){
 alert(1);
 event.cancelBubble = true;
 },
 show1:function(){
 alert(2);
 }
 }
 });
 }
 </script>
</head>
<body>
 <div id="box">
 <div @click="show1()">
 <input type="button" value="按鈕" @click="show($event)"> 
 </div>
 </div>
</body>
</html>

<2>利用vue的方法阻止冒泡:給HTML元素綁定click事件的時候,改為@click.stop="show()"

<!DOCTYPE html>
<html>
<head>
 <title></title>
 <meta charset="utf-8">
 <script src="http://unpkg.com/vue/dist/vue.js"></script>

 <script type="text/javascript">
 window.onload = function(){
 var vm = new Vue({
 el:'#box',
 methods:{
 show:function(event){
 alert(1);
 //event.cancelBubble = true;
 },
 show1:function(){
 alert(2);
 }
 }
 });
 }
 </script>
</head>
<body>
 <div id="box">
 <div @click="show1()">
 <input type="button" value="按鈕" @click.stop="show()"> 
 </div>
 </div>
</body>
</html>

3.默認行為

比如contextmenu右鍵菜單

<!DOCTYPE html>
<html>
<head>
 <title></title>
 <meta charset="utf-8">
 <!-- // <script src="vue.js"></script> -->
 <script src="http://unpkg.com/vue/dist/vue.js"></script>

 <script type="text/javascript">
 window.onload = function(){
 var vm = new Vue({
 el:'#box',
 methods:{
 show:function(){
 alert(1);
 },
 show1:function(){
 alert(2);
 }
 }
 });
 }
 </script>
</head>
<body>
 <div id="box">
 <input type="button" value="按鈕" @contextmenu="show()"> 
 <input type="button" value="按鈕1" @contextmenu.prevent="show1()"> 

 <p>//按鈕右擊點下去會依次出現 彈窗 1, 還有右擊的默認菜單</p>
 <p>//按鈕1右擊只出現 彈窗 2</p>
 </div>
</body>
</html>

聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

本文如未解决您的问题请添加抖音号:51dongshi(抖音搜索懂视),直接咨询即可。

文檔

vue2.0的contextmenu右鍵彈出菜單的實例代碼

vue2.0的contextmenu右鍵彈出菜單的實例代碼:整理文檔,搜刮出一個vue2.0的contextmenu右鍵彈出菜單的實例代碼,稍微整理精簡一下做下分享。 1.事情對象 <!DOCTYPE html> <html> <head> <title></title> <meta charset=ut
推薦度:
標簽: VUE 右鍵 彈出菜單
  • 熱門焦點
專題
Top
主站蜘蛛池模板: 灵寿县| 元朗区| 咸宁市| 普定县| 宁夏| 北海市| 美姑县| 南充市| 敦煌市| 崇文区| 保亭| 家居| 嘉峪关市| 东港市| 门头沟区| 高台县| 洛南县| 永仁县| 治县。| 滁州市| 东海县| 尉犁县| 桂林市| 古交市| 安多县| 昌乐县| 海兴县| 壤塘县| 嘉鱼县| 甘谷县| 温州市| 张掖市| 苏尼特右旗| 杭锦旗| 九寨沟县| 东乌珠穆沁旗| 陵水| 建湖县| 南部县| 环江| 颍上县|

抖音扫码关注

手机端二维码

每天分享百科知识!