Ilya
Ilya

Reputation: 1

Multiple js files in code playground

I want to create app like JSfiddle but with support of multiple files, like in codesandbox. I’ll create folder tree like below. but how to use it in import statement (import a from ‘./a.js’) should I parse js file to extract path from import and get content along this path (node value), or what?

var app = new Vue({
  el: '#app',
  data:
  {
    value: '',
    tree: [
      {
        label: 'Root',
        value: 'root',
        nodes: [
          {
            label: 'Child with children',
            value: 'child_parent',
            nodes: [
              {
                label: 'Child from child',
                value: 999
              }
            ]
          },
          {
            label: 'Child lonewolf',
            value: -10
          }
        ],
      }
    ],
  }
});

Upvotes: 0

Views: 3806

Answers (1)

billb
billb

Reputation: 3619

I think you're looking for codesandbox.io. When you create a sandbox, you get the ability to add multiple files.

codesandbox ide

As you can see in my example, I was able to create the file a.js by clicking the New File icon.

Upvotes: 1

Related Questions