Bladeren bron

fix:代码优化

cmy 4 weken geleden
bovenliggende
commit
15fd56897b
3 gewijzigde bestanden met toevoegingen van 44 en 4 verwijderingen
  1. 14 1
      main.html
  2. 15 1
      react-test/src/App.js
  3. 15 2
      vue-test/src/App.vue

+ 14 - 1
main.html

@@ -4,10 +4,23 @@
 <head>
   <meta charset="UTF-8">
   <title>Document</title>
+  <style>
+    button {
+      width: 100px;
+      height: 30px;
+      background-color: #4CAF50;
+      color: white;
+      border: none;
+      border-radius: 5px;
+      cursor: pointer;
+    }
+  </style>
 </head>
 
 <body>
-  这是一个空页面
+  谷歌埋点Demo - js
+  <br>
+  <strong>埋点统计数据会有延迟,请耐心等待</strong>
   <button id="btn" onclick="handleClick()">点击我</button>
 </body>
 <!-- Google tag (gtag.js) -->

+ 15 - 1
react-test/src/App.js

@@ -24,8 +24,22 @@ function App() {
   }
 
   return (
-    <div className="App">
+    <div className="App" style={{
+      textAlign: 'left',
+    }}>
+      谷歌埋点Demo - react
+      <br />
+      <strong>埋点统计数据会有延迟,请耐心等待</strong>
       <button
+       style={{
+        width: '100px',
+        height: '30px',
+        backgroundColor: '#4CAF50',
+        color: 'white',
+        border: 'none',
+        borderRadius: '5px',
+        cursor: 'pointer',
+       }}
         onClick={handleClick}
       >
         按钮

+ 15 - 2
vue-test/src/App.vue

@@ -1,5 +1,8 @@
 <template>
-  <div @click="handleClick">点击我</div>
+  谷歌埋点Demo - vue
+  <br>
+  <strong>埋点统计数据会有延迟,请耐心等待</strong>
+  <button @click="handleClick">点击我</button>
 </template>
 
 <script setup>
@@ -77,6 +80,16 @@ onUnmounted(() => {
   -moz-osx-font-smoothing: grayscale;
   text-align: center;
   color: #2c3e50;
-  margin-top: 60px;
+  text-align: left;
 }
+
+button {
+    width: 100px;
+    height: 30px;
+    background-color: #4CAF50;
+    color: white;
+    border: none;
+    border-radius: 5px;
+    cursor: pointer;
+  }
 </style>