File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -162,11 +162,15 @@ const selectedPMAction = computed(() => currentPM.value.action)
162162const installCommand = computed (() => {
163163 if (! pkg .value ) return ' '
164164 const pm = currentPM .value
165+ let command = ` ${pm .label } ${pm .action } ${pkg .value .name } `
165166 // deno uses "add npm:package" format
166167 if (pm .id === ' deno' ) {
167- return ` ${pm .label } ${pm .action }${pkg .value .name } `
168+ command = ` ${pm .label } ${pm .action }${pkg .value .name } `
168169 }
169- return ` ${pm .label } ${pm .action } ${pkg .value .name } `
170+ if (requestedVersion .value ) {
171+ command += ` @${requestedVersion .value } `
172+ }
173+ return command
170174})
171175
172176// Copy install command
@@ -511,7 +515,10 @@ defineOgImageComponent('Package', {
511515 > {{ pkg.name }}</span ><span
512516 v-else
513517 class =" text-fg-muted"
514- >{{ pkg.name }}</span ><template #fallback ><span class =" text-fg" >npm</span >  ; <span class =" text-fg-muted" >install {{ pkg.name }}</span ></template ></ClientOnly ></code >
518+ >{{ pkg.name }}</span ><span
519+ v-if =" requestedVersion"
520+ class =" text-fg-muted"
521+ >@{{ requestedVersion }}</span ><template #fallback ><span class =" text-fg" >npm</span >  ; <span class =" text-fg-muted" >install {{ pkg.name }}</span ></template ></ClientOnly ></code >
515522 </div >
516523 </div >
517524 <button
You can’t perform that action at this time.
0 commit comments