javascript 的默认导出代码在 tailwindcss 中不起作用

时间:2021-05-30 04:55:29

标签: javascript html css click tailwind-css

我正在尝试建立一个简历网站

我的 index.html 中有一个代码

我正在尝试使用 java 脚本和顺风 css 关闭并在鼠标单击时打开导航栏,但它不起作用

这是我的代码

<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]>      <html class="no-js"> <!--<![endif]-->
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>Tail wind example</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="build/tailwind.css">
      <header class="flex items-center justify-around bg-black">
       
        <img src=""/ class="h-8">
        
        <button @click="isOpen=!isOpen" type="button" class="text-black bg-blue-900 focus:text-white hover:text-red-900">Dude</button>

 
      <div class= " isOpen ? 'block':'hidden'"class="px-2 pb-4">
        <a href="#" class="block px-2 bg-white py-1font-semibold hover:bg-blue-300">Resume1</a>
        <a href="#" class="block px-2 mt-1 py-1font-semibold hover:bg-blue-300">Resume1</a>
        <a href="#" class="block px-2 py-1font-semibold hover:bg-blue-300">Resume1</a>
        <a href="#" class="block px-2 mt-1 py-1font-semibold hover:bg-blue-300">Resume1</a>    <a href="#" class="block px-2 py-1font-semibold hover:bg-blue-300">Resume1</a>
        <a href="#" class="block px-2 mt-1 py-1font-semibold hover:bg-blue-300">Resume1</a>
      </header>
      </div>
  
    </head>
    <body>
 


        

    </body>
    <script>

      export default{
    
        data(){

          return{
            isOpen:false,

          }

        }
      }
    </script>

</html>

我在 Tailwindcss 上观看了 Adam Wathan 的 YouTube 视频

这主要来自这个视频https://www.youtube.com/watch?v=qrTsS3z8BAw

这是我的输出

My Output

我在控制台中运行了 live-server public

0 个答案:

没有答案