我是vite的新手,我安装了,编写了一些代码,执行了npm run dev和npm run build。
一切都很顺利,直到上传到我的服务器。
索引.html:
<script type="module" crossorigin src="/assets/index.a673cca3.js"></script>
Run Code Online (Sandbox Code Playgroud)
从实时服务器运行时,我收到这些错误
Failed to load resource: net::ERR_FAILED index.4293b7ae.css:1
Failed to load resource: net::ERR_FILE_NOT_FOUND index.a673cca3.js
Run Code Online (Sandbox Code Playgroud)
文件名是正确的,并且它们位于应该的位置。
是什么赋予了?
我有一个600x400px的图像,并希望它在240x200px的较小div中,但图像缩小或变形.我希望原始大小的图像以较小的div为中心,这会隐藏一些图像
我写了这个CSS规则来应用于不同的图像大小.
.theBox {
float: left;
overflow: hidden;
width: 240px;
height: 200px;
}
.theBox img {
display: block;
height:100% !important;
width:100% !important;
}
Run Code Online (Sandbox Code Playgroud) 当设备从纵向旋转到横向时,视图的宽度约束会更新,但是当设备从横向旋转到纵向时,视图的宽度约束不会更新
我的代码:
override func viewDidLoad() {
super.viewDidLoad()
theView.translatesAutoresizingMaskIntoConstraints = false
theView.topAnchor.constraint(equalTo: view.topAnchor, constant: 0).isActive = true
theView.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: 0).isActive = true
theView.leftAnchor.constraint(equalTo: view.leftAnchor, constant: 0).isActive = true
theView.rightAnchor.constraint(equalTo: view.rightAnchor, constant: 0).isActive = true
}
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
Run Code Online (Sandbox Code Playgroud)
首次将设备从纵向旋转为横向时,“ theView”宽度为视图宽度的50%
if UIDevice.current.orientation.isLandscape {
theView.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.50).isActive = true
Run Code Online (Sandbox Code Playgroud)
从横向旋转到纵向无法恢复原始宽度
} else {
theView.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 1.00).isActive = true
}
}
Run Code Online (Sandbox Code Playgroud)
这是一张图像,显示了我正在尝试做的事情。
刚刚完成和使用核心数据和 iCloud 同步的应用程序。在模拟器和设备上进行测试时,该应用程序运行良好:将文本和图像添加到持久存储没有问题,所有数据都已恢复,所有设备:在模拟器和真实 iPhone 上。我做了很多测试,比如从手机和模拟器中删除应用程序,每次我重新安装/运行应用程序时数据仍然存在。
现在该应用程序在应用程序商店中“上线”,但数据未在设备之间同步。我已使用相同的 Apple 用户名/ID 在两部 iPhone 上安装,在两部设备上都添加了记录,但数据并未按预期在每部手机上恢复或复制。
有任何想法吗?