Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <template>
  <div id="app">
    <div class="container">
      <div class="center-section">
        <h2>訪客預約類別</h2>
        <div class="box">
          <div>
            <strong>起始時間</strong>
            <input type="datetime-local" id="appointment-time" name="appointment-time" />
          </div>
          <div>
            <strong>結束時間</strong>
            <input type="datetime-local" id="appointment-time" name="appointment-time" />
          </div>

          <Pie id="my-chart-id" :options="chartOptions" :data="chartData" />
        </div>

        <div class="east">
          <a href="redg.vue">訪客預約類別</a>
        </div>
      </div>

      <div class="right-section">
        <h3>楊梅物流中心</h3>
        <h4>車輛進出紀錄</h4>
        <img src="../assets/Group2.png" width="50" height="50" />
        <div class="adef">
          <h5>駕駛公司:A物流公司</h5>
          <h5>駕駛人:王先生</h5>
          <h5>車牌號碼:Ac-2345</h5>
          <h5>車種:貨車</h5>
          <h5>進場時間:2023/06/23 12:00</h5>
        </div>
        <div class="adef">
          <img src="../assets/Group2.png" width="50" height="50" />
          <h5>駕駛公司:A物流公司</h5>
          <h5>駕駛人:王先生</h5>
          <h5>車牌號碼:Ac-2345</h5>
          <h5>車種:貨車</h5>
          <h5>進場時間:2023/06/23 12:00</h5>
        </div>
      </div>
    </div>

    <div>
      <router-link to="/"></router-link>
      <router-link to="/Page2"></router-link>
      <router-view></router-view>
    </div>
  </div>
</template>
              
            
!

CSS

              
                <style>
#app {
  font-family: "Avenir", Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-font-smoothing: grayscale;
  text-align: center;
  margin-bottom: 60px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
}

.container {
  width: 100%;
  display: flex;
  justify-content: center;
}

.app {
  padding: 20px;
  border: 1px solid transparent;
  border-radius: 5px;
  background-color: rgb(202, 202, 202);
}

.left-section {
  background-color: rgb(202, 202, 202);
}

.center-section {
  background-color: #ffffff;
  padding: 20px;
}

.right-section {
  background-color: #e0e0e0;
  width: 20%;
}

.left-section h2 {
  border-bottom: 1px solid black;
  padding-bottom: 5px;
}

.left-section h4 {
  border: none;
  background-color: transparent;
  padding: 0;
  cursor: pointer;
  font-size: inherit;
  color: inherit;
  width: auto;
  text-decoration: underline;
}

.right-section h4 {
  border-bottom: 1px solid black;
  padding-bottom: 5px;
}

.right-section img {
  float: left;
}

.adef {
  padding-bottom: 5px;
  width: auto;
  font-size: 12px;
}

.right-section {
  float: right;
}

.box {
  overflow: auto;
  background-color: rgb(202, 202, 202);
}

.center-section table {
  width: 100%;
  border-collapse: collapse;
}

.center-section table tr,
th {
  padding: 10px;
  text-align: center;
}

.gwee {
  display: flex;
  align-items: center;
  justify-content: center;
}

.east {
  text-align: right;
}

.record {
  width: 100%;
  margin-bottom: 20px;
  overflow-y: auto;
  max-height: 400px;
  border-collapse: collapse;
}

.record th,
.record td {
  border: 1px solid #ddd;
  text-align: center;
  padding: 8px;
  font-size: 10px;
}

th input[type="checkbox"] {
  margin-right: 5px;
}

.record th {
  background-color: #f2f2f2;
}

.checkbox {
  text-align: center;
}

.image-button {
  border: none;
  background: none;
  padding: 0;
}

.image-button img {
  width: 25px;
  height: 25px;
  transition: transform 0.3s ease;
}

.image-button img:hover {
  transform: scale(0.9);
}

.checkbox {
  width: 20px;
  height: 20px;
}
input[type="datetime-local"] {
  width: 200px;
  height: 30px;
}
</style>

              
            
!

JS

              
                <script>
import { Pie } from "vue-chartjs";
import { Chart as ChartJS, ArcElement, Tooltip, Legend } from "chart.js";

ChartJS.register(Tooltip, Legend, ArcElement);
export default {
  name: "PieChart",
  components: { Pie },
  extends: Pie,
  data() {
    return {
      newReservation: {
        plateNumber: "",
        total: "",
      },
      records: [],
      chartData: {
        labels: ["住戶預約", "現場預約"],
        datasets: [
          {
            data: [30, 70],
            backgroundColor: ["#FF3B3B", "#FFAC12"],
          },
        ],
      },
      chartOptions: {
        responsive: true,
        maintainAspectRatio: true,
        aspectRatio: 1,
        width: 50,
        height: 50,
        plugins: {
          tooltips: {
            callbacks: {
              label: function (tooltipItem, data) {
                var dataset = data.datasets[tooltipItem.datasetIndex];
                var total = dataset.data.reduce(function (
                  previousValue,
                  currentValue,
                  _currentIndex,
                  _array
                ) {
                  return previousValue + currentValue;
                });
                var currentValue = dataset.data[tooltipItem.index];
                var percentage = Math.floor((currentValue / total) * 100 + 0.5);
                return currentValue + " (" + percentage + "%)";
              },
            },
          },
        },
      },
    };
  },
  methods: {
    renderChart(data, options) {
      const ctx = this.$refs.chart.getContext("2d");
      new C(ctx, {
        type: "Pie",
        data: data,
        options: options,
      });
    },
    mounted() {
      this.renderChart(this.chartData, this.chartOptions);
    },
  },
};
</script>
              
            
!
999px

Console