Get a error ues vue3 with cdn when creating a variable of ref in setup

the code is :

  <meta charset="UTF-8">

  <meta http-equiv="X-UA-Compatible" content="IE=edge">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title> api-setup</title>

  <script src="../../vue.global.js"></script> 

</head>

<body>

  <div id="app">

    <h3>{{b}}</h3>

  </div>

  <script>

    const app = Vue.createApp({

      setup() {

        const b = ref(2)

        console.log(b)

        return {

          b

        }

      }

    })

    const vm = app.mount('#app')

  </script>

</body>

the error is :slight_smile:
图片

As you are using a CDN you need to use the global to access Vue.

const app = Vue.createApp({
  setup() {
    const b = Vue.ref(2)

    return {
      b
    }
  }
})

const vm = app.mount('#app')

Fiddle: https://jsfiddle.net/jamesbrndwgn/713ywLav/

thank you very much ,my master, i got it !