Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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


Add Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import or require. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.


Save Automatically?

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.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <div id="app">
  <div v-for="value in arr">{{value}}</div>
  <div v-for="key in obj">{{key}}</div>
   <button @click="noChange">打开控制台,可以看到值改变视图不更新</button>
   <button @click="beginValue">初始化数组,对象</button>
     <button @click="changeValue">改变值更新视图</button>
       <button @click="arrMethod">数组方法触发更新视图</button>
              const vm = new Vue({
  el: "#app",
  data: {
    arr: [1, 2, 3],
    obj: {
      a: 1,
      b: 2
  methods: {
    noChange() {
      // 打开控制台可以看到arr obj 值都改变了

      this.arr[0] = "OBKoro1";
      this.arr.length = 1;
      this.obj.c = "OBKoro1";
      delete this.obj.a;
    beginValue() {
      // 这种写法也能改变视图,覆写了数据,不是改变其中的数据
      this.arr = [1, 2, 3];
      this.obj = {
        a: 1,
        b: 2
    changeValue() {
      this.$set(this.arr, 0, "OBKoro1");
      this.$set(this.obj, "c", "OBKoro1");
    arrMethod() {
      // 删除数组位置2,并添加一个新值
      this.arr.splice(2, 1, "数组方法添加");