# 添加资源
URL: /%E6%96%87%E6%A1%A3/04.%E5%BC%80%E5%8F%91%E6%96%87%E6%A1%A3/01.%20%E5%89%8D%E7%AB%AF%E5%BC%80%E5%8F%91/05.%20%E5%B9%B3%E5%8F%B0%E5%BC%80%E5%8F%91/01.%20%E5%B0%8F%E7%A8%8B%E5%BA%8F%E5%BC%80%E5%8F%91/09.%20XR-FRAME/0.1%20%E6%B7%BB%E5%8A%A0%E8%B5%84%E6%BA%90


## 1.0 主动加载静态资源
```html
<xr-asset-load asset-id="anim" type="keyframe" src="/static/animation/miku-kawaii-animation.json"/>
```
## 1.1 手动加载静态资源 和 动态插入模型(gltf)
wxml
```html
// 是一种特殊的节点，开发者**仅可在其下以及子孙挂载自己创建的节点**
<xr-shadow id="shadow-root"></xr-shadow>
```
js
```js
 // 场景示例
const scene = this.scene = detail.value;

// 这里是实例包含了文件API[classes]
const xrFrameSystem = wx.getXrFrameSystem();

// 获取挂载元素的节点
this.shadowRoot = scene.getElementById('shadow-root');

// 手动获取静态资源
const {value: model} = await scene.assets.loadAsset({type: 'gltf', assetId: 'damage-helmet', src: 'https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/damage-helmet/index.glb'});

this.damageModle = model

// 直接创建一个XRGLTF元素，但注意要和`Shadow元素`一起使用
const gltfElement = scene.createElement(xrFrameSystem.XRGLTF);

// 插入到节点下
this.shadowRoot.addChild(gltfElement);

// 获取组件
const gltfComp = gltfElement.getComponent(xrFrameSystem.GLTF);

// 更新组件
gltfComp.setData({model: model});
```
