3.2.0 • Published 9 months ago

setupin v3.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

😏 setupin 是什么?

setupin 允许你在 HTML 中编写 Vue 的 \语法。

利用vue/compiler-sfc,在运行时编译为esm格式的vue代码,并动态执行。

🤯 代码对比

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>esm</title>
  <style>
    button {
      font-size: larger;
    }
  </style>
</head>
<body>
  <div id="app">
    <button @click="count++">{{ count }}</button>
  </div>

  <script type="module">
    import { createApp, defineComponent, ref } from 'https://unpkg.com/vue/dist/vue.esm-browser.js';
    const App = defineComponent(() => {
      const count = ref(0);
      return {
        count
      };
    });
    createApp(App).mount('#app')
  </script>
</body>
</html>
<script setup>
  import { ref } from 'vue'
  const count = ref(0)
</script>

<template>
  <button @click="count++">{{ count }}</button>
</template>

<style>
  button {
    font-size: larger;
  }
</style>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>setupin</title>
  <script src="https://unpkg.com/setupin"></script>
</head>

<script setup>
  import { ref } from 'vue'
  const count = ref(0)
</script>

<template>
  <button @click="count++">{{ count }}</button>
</template>

<style>
  button {
    font-size: larger;
  }
</style>

除了\之外和\写法完全一致

🤓 特性

🤔 为什么选择 setupin

  1. 便于学习 为初学者提供一个友好的环境,帮助他们轻松上手 Vue 的核心用法。

  2. 简易开发 提供便捷的方式,助力快速开发小网页,无需繁琐的配置。

  3. 快速体验 让用户可以快速在 HTML 中尝试 Vue 的新特性,感受其魅力。

😝 演练场

stackblitz 上尝试一下吧!

🥰 CDN

<!-- 默认是dev版本 -->
<script src="https://unpkg.com/setupin"></script>

<!-- dev -->
<script src="https://unpkg.com/setupin/dist/main.js"></script>

<!-- prod -->
<script src="https://unpkg.com/setupin/dist/main.prod.js"></script>
2.5.0-beta.1

9 months ago

2.5.0-beta.2

9 months ago

3.0.0-beta.2

9 months ago

2.4.1

9 months ago

2.6.1

9 months ago

2.4.3

9 months ago

2.6.0

9 months ago

2.5.1

9 months ago

2.4.2

9 months ago

2.6.2-beta.1

9 months ago

3.1.2

9 months ago

3.2.0

9 months ago

3.1.1

9 months ago

3.1.0

9 months ago

3.0.0

9 months ago

2.3.0

10 months ago

2.2.3

10 months ago

2.4.0

9 months ago

2.3.1

10 months ago

2.2.1

10 months ago

2.2.0

10 months ago

2.2.2

10 months ago

2.1.9

10 months ago

2.1.10

10 months ago

2.1.8

10 months ago

2.1.7

10 months ago

2.1.6

10 months ago

2.1.5

10 months ago

2.1.4

10 months ago

2.1.3

10 months ago

2.1.2

10 months ago

2.1.1

10 months ago

2.1.0

10 months ago

2.0.0

10 months ago

1.0.0

10 months ago

0.0.12

10 months ago

0.0.11

10 months ago

0.0.10

10 months ago

0.0.9

11 months ago

0.0.8

11 months ago

0.0.7

11 months ago

0.0.6

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.0

11 months ago